Quit Script under these conditions leaving screen with no remnants of it or warnings
Quit Script if no entry, wrong entry or no entry after 20 seconds
Would like to be able to add to this script provided by Niel so that if there was no entry for the passphrase, wrong entry, or 20 seconds have elapsed, the script would quit with no warning.
tell application "Finder"
if not exists disk "TEST" then
set thePassword to text returned of (display dialog "A password is required." default answer "" with hidden answer)
do shell script "diskutil apfs unlockvolume UUID -passphrase " & thePassword
end if
end tell
It would leave the screen as if the password was put in correctly in 20 seconds.
I have tried with timeout of 10 seconds at the beginning and end timeout at the end but still gives: Apple event timed out and leaves the password dialog box on the screen.
Thanks
iMac (2017 – 2020)