Password Collecting - Stop Repeat

Hi Folks,

I am trying to get a password by using the following code:

if name of theObject is "bt_press" then
set password to contents of text field "txt_password" of window "password"


if password is "1234" then exit repeat
if password is not equal to "1234" then
set contents of text field "txt_password" of window "password" to ""
set contents of text field "txt_msg" of window "password" to "wrong pass"

end repeat
end if

What can I do to stop/pause/break the repeat after one entry has been made - or after the text field “txt_password” has been set to " "!

The result at the moment will cause only one entry in the beginning and no other entry is possible inside the loop…

Thanks for your help!


Hi Stefan,

this thread better belongs to Xcode forum :wink:

this construction cannot work at all.
I would use the end editing handler or something similar
to get the complete password and then proceed it