I wrote this quickie AppleScript application, only to find that it didn't behave as expected.
property defaultDelayMin : 10 -- minutes
on run
repeat
display dialog "Set time out minutes to ..." default answer defaultDelayMin
try
set delayMin to (text returned of the result) as number
exit repeat
end try
end repeat
set defaultDelayMin to delayMin
display dialog defaultDelayMin -- diagnostic, confirm that 'defaultDelayMin' has been changed
delay (delayMin * 60) -- seconds
tell application "Finder" to beep
end run
The diagnostic line reports the correct value and if the script is allowed to run to the beep, the default value for the next run is the value entered on the previous run.
But what happens if I force quit the application while it's doing the 'delay'?
The diagnostic line reports that the value of 'defaultDelayMin' has been changed, but on the next run, I find that the value has not been changed.
I can't explain this, but no doubt someone can.