Environment:
I’m scheduling AppleScripts using Automator on Mac OS X 10.9.4. I’m scheduling it with Calendar. I’ve tested the scripts on a MBP 17" Early-2010 and a MBP 17" Mid-2011
The Issue:
The scripts will not run when the screen sleeps or after the system has just been scheduled to “wake up.” If the screen is unlocked and awake or the screensaver is on and the screen is awake, the scripts will run fine.
My theory is that the primary issue has to do with No capable display being found.
A screenshot of my log in the Console when the AppleScript was scheduled to run can be found here.
https://drive.google.com/file/d/0B0jD59pT37M-ZXU4NldnRG5ISFE/edit?usp=sharing
Desired Outcome:
Ideally, we’d like to keep the screen off and not even have to login to the machine to run the scheduled scripts, but that doesn’t seem to be an option right now.
Current Workaround:
We are keeping a Mac on all the time with at least the screensaver on with a screen lock at the lowest brightness setting. At the top of my script, it detects whether there is a screensaver running and then unlocks the login screen if there is one.
Attempts to fix the issue
I’ve tried a variety of different things to try to simply activate the sleeping screen when it’s a asleep without human input. Though it would be ideal if the script would run with a screen that’s off, simply getting the screen to wake up and logging in would be great too.
I used this post specifically from this forum as well as other techniques: http://macscripter.net/viewtopic.php?id=41950
Caffeinate:
delay 4
do shell script "caffeinate -u true"
Using shell app called cliclick to use terminal to make a click:
do shell script "'/usr/local/bin/cliclick' c:."
Using freeware Caffeine
tell application "Caffeine"
turn on for 10
delay 10
quit
end tell
Any help would be appreciated.