Kurt Knippel Posted January 31, 2002 Posted January 31, 2002 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?
Steven H. Blackwell Posted February 1, 2002 Posted February 1, 2002 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
Kurt Knippel Posted February 1, 2002 Author Posted February 1, 2002 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.
h2o Posted February 3, 2002 Posted February 3, 2002 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
Recommended Posts
This topic is 8328 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now