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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to