Script fails with timeout errror

Hello,

I’m very new to Apple Script. That said, I’m running a Parallels Desktop virtual machine and simply want to quit the Parallels app before Time Machine begins it’s nitely backup and then relaunch Parallels after Time Machine has completed the backup. I’ve tried using the following scripts below, however when executed both produce the following error “AppleEvent timed out. (-1712)”. Here’s where it gets really strange, both scripts work perefectly just so long as the screen is awake, but if my computer has been idle for a while and the screen is asleep, I get the previous error. I even tried creating an automator script by recording my cursor movements and it tested fine while the screen was awake, but again failed once the computer was idle and the screen went to sleep…

tell application “Parallels Desktop” to quit

tell application “Parallels Desktop” to activate

Any ideas,
Thanks so much!
Chuck

Model: iMac 2011
Browser: Safari 602.1
Operating System: Mac OS X (10.10)

Unfortunately Time Machine ™ doesn’t have any pre- or post scripts that can be attached. That means you cannot run an AppleScript before TM starts. However you can run TM “manually” using the tmutil shell command. You can turn TM off and run an script every hour that kills/quits Parallels and start TM.

The shell command you’re looking for and can be called using a do shell script is probably

[format]tmutil startbackup --auto --block [/format]

Thanks so much for the reply. Actually, time machine isn’t the issue for me as I am manually triggering it at a specific time of day successfully. The issue is that my Apple Scripts used to quit/launch Parallels Desktop are only working if the display is on, but fails with a timeout error once the display sleeps. Just to be clear, my iMac is never entering sleep as it’s set to always on, I’m just referring to the display itself…