• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to start/restart the Finder from an AS app?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: How to start/restart the Finder from an AS app?
      • From: "Mark J. Reed" <email@hidden>
References: 
 >Re: How to start/restart the Finder from an AS app? (From: "Stockly, Ed" <email@hidden>)

  • Prev by Date: Re: Help with mail please
  • Next by Date: Re: How to start/restart the Finder from an AS app?
  • Previous by thread: Re: How to start/restart the Finder from an AS app?
  • Next by thread: Re: How to start/restart the Finder from an AS app?
  • Index(es):
    • Date
    • Thread