I have a backup script that runs at 1am on a few machines that I am having an odd problem with. When the script starts it puts up a dialog box to allow the user to cancel if they happen to still be working on the machine in the middle of the night:
display dialog "Preparing to start a Backup" buttons {"Okay", "NO-NO-NO! Stop!"} default button 1 giving up after 10 with icon note
This works fine except some users insist on activating the screen saver that requires them to type in their password to regain access to the machine as a little inter-office security. In these cases the script launches fine, but the “giving up after 10” bit of the dialog box is somehow ignored and the script hangs with an applescript timeout.
So instead of banning the screen saver security or taking out all of the scripts dialogs, I’m wondering if there is a way to dismiss the screen saver via applescript before any dialogs come up?