Any way to ensure that my app will terminate before Finder does on log out, restart, etc.?
Any way to ensure that my app will terminate before Finder does on log out, restart, etc.?
- Subject: Any way to ensure that my app will terminate before Finder does on log out, restart, etc.?
- From: "Steve Voida" <email@hidden>
- Date: Mon, 13 Aug 2007 00:02:15 -0400
I have a Cocoa app that makes a couple of AppleScript calls to the Finder
just before terminating to clean up my app's state (setting Finder Comments
on files, restoring the desktop background...things of that nature). The app
typically makes all of these calls in a very short time; they're not
expensive or computationally-expensive scripting requests.
That said, when the user (or the system) invokes a "log out," "restart," or
"shut down" request, the Finder often completes its termination before my
application does, making my AppleScript calls silently fail and leaving bits
of pieces of my clean-up process undone. Is there any way for my application
to register as a sort of delegate on Finder to delay its termination just
long enough for my clean up process to complete, or to otherwise prioritize
my application's receipt of the applicationShouldTerminate: message so that
I at least have a half-decent head start in tidying up? I was hoping that
there might be something useful in NSWorkspace I could use or an Apple
Events call that I could manufacture, but I'm coming up empty on ideas....
Thanks in advance,
Steve Voida
Georgia Tech
_______________________________________________
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