Re: Quit app and retarget
Re: Quit app and retarget
- Subject: Re: Quit app and retarget
- From: has <email@hidden>
- Date: Fri, 16 Apr 2010 23:10:45 +0100
Jonathan Mitchell wrote:
> The following script fails with Xcode got an error if Xcode is already running: Connection is invalid.
> Presumably this is because I quit xcode and then retarget.
As you say, it's a timing issue. 'quit' returns immediately, so the next command is being sent the process while it's still shutting down.
Safest solution is to wait until the process has terminated before proceeding, e.g.:
tell application "Finder"
quit
repeat while running
delay 0.1
end repeat
home
end tell
has
--
Control AppleScriptable applications from Python, Ruby and ObjC:
http://appscript.sourceforge.net
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden