January 31, 200223 yr code: display dialog "Please enter your password..." default answer "" default button "OK" giving up after 5 copy (dialog reply button returned) to v_button I run the dialog and get an "Execution Error" message. It says "Cannot make some data into the expected type". I am sure that I have some formatting errors, but I do not know what. Any suggestions?
February 1, 200223 yr Kurt: What are you trying to do here? display dialog "Enter PW" default answer "" buttons {"OK"} default button 1 set v_button to button returned of result as string display dialog v_button will return and display the name of the button clicked whereas display dialog "Enter PW" default answer "" buttons {"OK"} default button 1 set pw_text to text returned of result as string will capture what's entered in the text box Old Advance Man
February 1, 200223 yr Author Basically I am trying to do 2 things. One is to make sure that the user pressed the "OK" button and if so capture the text that they entered into the "Password" field. I am sure that my process is correct, I am just having touble with the syntax. I'll try your suggested format and see what the results are.
February 3, 200223 yr quote: Basically I am trying to do 2 things. One is to make sure that the user pressed the "OK" button and if so capture the text that they entered into the "Password" field. here a little solution. set PWT to "" set PW to {text returned:PWT, button returned:"", gave up:false} repeat until (gave up of PW is true) or (text returned of PW is not PWT) set PW to (display dialog "Enter PW" default answer "" buttons {"OK"} default button 1 giving up after 5) end repeat if gave up of PW is false then -- something using (text returned of PW) else -- other thing end if
Create an account or sign in to comment