On Yosemite 10.10.5, I have an Apples Script application that runs and completes as desired under 2 of 3 conditions. The application is set to launch, by launchd plist 3 times per day at 7:05am, 3:05pm and 9:05pm.
- Completes - when run from Script Editor
- Completes - when running under launchd at 7:05am
- Applescript timeout warning - when running under launchd after ~7:21am and when the monitor is black
It may be important to the #2 success that the Energy Saver > Scheduled > Start up or wake = 7:00am, everyday. > Sleep = 11pm everyday. Also, Computer Sleep = Never and Display Sleep = 15 min.
The error message is
Safari got an error: AppleEvent timed out. (-1712)
The 1st arrow below points to the line of code where timeout occurs. The hack is displayed at the 2nd arrow, allowing the script to 'gracefully' continue:
If I should wake up the screen within 2 minutes of the 1st arrow's code being sent, the script will continue fine.
Nothing related is in the Console system log. I am thinking this is a bug.
Does anyone have any ideas of how to troubleshoot or solve this?