Waking the computer to allow AppleScript to run
I have a number of AppleScript applications that need to run at odd times. These maintenance tasks often attempt to run while the computer is sleeping. Particularly those that rely on UI scripting do not function during this period.
This most flexible way of dealing with this is to manipulate the power management settings directly via the pmset(1) command.
The variety of options available using pmset
is staggering and beyond the scope of this post. Here’s what I do to wake the computer up at specific times so that scheduled AppleScripts can run: