Re: Using NSSupportsSuddenTermination
Re: Using NSSupportsSuddenTermination
- Subject: Re: Using NSSupportsSuddenTermination
- From: Axel Luttgens <email@hidden>
- Date: Mon, 30 Nov 2009 22:25:54 +0100
Le 30 nov. 2009 à 08:23, Tom Robinson a écrit :
> Hi guys,
>
> I have a small AppleScript application which stays running in a repeat loop while the user is logged in. I'd like to hook into Leopard's Sudden Termination so it quits quickly when said user logs out.
>
> e.g.:
>
> repeat
> do shell script "logger 'hi'"
> delay 2
> end repeat
>
> I've tried adding NSSupportsSuddenTermination to the application's Info.plist but it seems to be ignored—Activity Monitor still says No.
>
> Here's what I added:
>
> […]
> <key>LSRequiresCarbon</key>
> <true/>
> <key>NSSupportsSuddenTermination</key>
> <true/>
> <key>WindowState</key>
> <dict>
> […]
>
> Have I missed something?
>
> Snow 10.6.2
Hello Tom,
I don't know anything about NSSupportsSuddenTermination, but couldn't good old AppleScript recipes do the trick as well? Something along those lines, saved as a stay-open application:
on idle
do shell script "logger 'performing my periodic tasks'"
return 2
end idle
on quit
do shell script "logger 'performing my cleanup tasks'"
continue quit
end quit
This relies upon the fact that applications are sent a quit event at logout.
HTH,
Axel
_______________________________________________
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