Hi all,
Unfortunately ASS doesn’t support hidden text in dialogs so I’m kinda stuck trying to make my own dialogs but I’m getting really stuck.
My app requires a password check and for the users to setup thier password i need to check their first entry for a password with a entry. In normal applescript this would be very easy:
repeat
set a to display dialog "Please enter your new password" default answer "" buttons {"OK"} default button 1 with hidden answer
set passCheck_1 to text returned of a
set b to display dialog "Please verify your new password" default answer "" buttons {"OK"} default button 1 with hidden answer
set passCheck_2 to text returned of b
if passCheck_1 is passCheck_2 then
set thePassword to passCheck_1
exit repeat
else
display dialog "Passwords do not match, please retry" buttons "OK" default button 1 with icon 0
end if
end repeat
end
In ASS I can easily make a dialog box with hidden text, but a repeat with these dialog boxes won’t work as it errors before the user can enter a password. My approach right now is something like this (which doesn’t work):
property passCheck_1 : ""
property passCheck_2 : ""
property thePassword : ""
on passwordCheck()
repeat
passwordWindow(1)
passwordWindow(2)
if passCheck_1 is passCheck_2 then
set thePassword to passCheck_1
exit repeat
else
display dialog "Passwords do not match, please retry" buttons "OK" default button 1 with icon 0
end if
end repeat
end passwordCheck
on passwordWindow(theNumber)
set text field "hiddenNumber" of window "passwordCheck" to theNumber
show window "passwordCheck"
end passwordWindow
on clicked theObject
set theNumber to contents of text field "hiddenNumber" of window "passwordCheck"
if theNumber is 1 then
set passCheck_1 to text field "passwordField" of window "passwordCheck"
else
set passCheck_2 to text field "passwordField" of window "passwordCheck"
end if
end clicked
I can’t seem to get my head around solving this in ASS, any suggestions?