Tuesday, June 27, 2017

#1 2017-06-17 07:35:42 am

ahwman
Member
Registered: 2017-06-17
Posts: 2

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)

Last edited by ahwman (2017-06-17 01:01:59 pm)


Filed under: applescript

Offline

 

#2 2017-06-18 07:34:40 pm

DJ Bazzie Wazzie
Member
From: the Netherlands
Registered: 2004-10-20
Posts: 2654

Re: Script fails with timeout errror

ahwman wrote:

Any ideas

Unfortunately Time Machine (TM) 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

tmutil startbackup --auto --block

Offline

 

#3 2017-06-18 07:43:43 pm

ahwman
Member
Registered: 2017-06-17
Posts: 2

Re: Script fails with timeout errror

DJ Bazzie Wazzie wrote:

ahwman wrote:

Any ideas

Unfortunately Time Machine (TM) 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

tmutil startbackup --auto --block

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...

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.039 seconds, 10 queries executed ]

RSS (new topics) RSS (active topics)