• 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: Relaunch Finder (without AppleScript)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Relaunch Finder (without AppleScript)


  • Subject: Re: Relaunch Finder (without AppleScript)
  • From: Uli Kusterer <email@hidden>
  • Date: Wed, 16 Jul 2008 16:35:08 +0200

On 16.07.2008, at 16:01, Dave DeLong wrote:
You could use an NSTask to run "killall Finder"


Yeah, and in the process you'll unceremoniously abort that 4GB copy process the user had going that was this close to finishing, and corrupt Finder's preferences...

If you're on 10.5, use the scripting bridge. If you're on 10.4.x or earlier, you can drop down to CoreServices and manually send the Apple Event. Create the event using NSAppleEventDescriptor, and then call - aeDesc to get an AEDesc to pass to AESend(). The quit Apple event is very simple, as it takes no parameters, and is of class/type kCoreEventClass/kAEQuitApplication.

Check the result, though, Finder may refuse to quit if it's busy, like aforementioned copy process.

 To launch Finder again after that, use NSWorkspace.

Cheers,
-- Uli Kusterer
"The Witnesses of TeachText are everywhere..."
http://www.zathras.de





_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >Relaunch Finder (without AppleScript) (From: Piero Avola <email@hidden>)
 >Re: Relaunch Finder (without AppleScript) (From: "Dave DeLong" <email@hidden>)

  • Prev by Date: Re: Base64 data string decode to save to file
  • Next by Date: Re: NSAppleScript - compileAndReturnError always breaks with EXC_BAD_ACCESS
  • Previous by thread: Re: Relaunch Finder (without AppleScript)
  • Next by thread: Re: Relaunch Finder (without AppleScript)
  • Index(es):
    • Date
    • Thread