• 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: Using NSSupportsSuddenTermination
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: Using NSSupportsSuddenTermination
      • From: Tom Robinson <email@hidden>
References: 
 >Using NSSupportsSuddenTermination (From: Tom Robinson <email@hidden>)

  • Prev by Date: Re: Changing File Permissions
  • Next by Date: Working with Selected text in MS Word 2008 find/Replace
  • Previous by thread: Using NSSupportsSuddenTermination
  • Next by thread: Re: Using NSSupportsSuddenTermination
  • Index(es):
    • Date
    • Thread