Re: How to start/restart the Finder from an AS app?
Re: How to start/restart the Finder from an AS app?
- Subject: Re: How to start/restart the Finder from an AS app?
- From: Christopher Nebel <email@hidden>
- Date: Thu, 20 Dec 2007 18:43:40 -0800
On Dec 19, 2007, at 12:54 PM, Stockly, Ed wrote:
Is there a syntax to call the Finder if it is not currently running?
Or if I wish to quit and restart the Finder?
I've found it's better if you don't put the quit and activate (or
run) in
the same tell block.
Also, after you issue the quit command it's more reliable if you delay
before doing the activate or run. Otherwise you may get a connection
invalid
error.
tell application "Finder" to quit
delay 10
tell application "Finder"
activate
end tell
Yeah, there's a bit of a race condition there. "Quit" isn't truly
synchronous -- when an application returns from its "quit" handler, it
isn't dead quite yet, so if there's no delay, the "activate" gets sent
to the dying application, hence the "connection invalid" error.
--Chris Nebel
AppleScript Engineering
_______________________________________________
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