• 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: Application Bundle won't quit at Shutdown
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Application Bundle won't quit at Shutdown


  • Subject: Re: Application Bundle won't quit at Shutdown
  • From: Axel Luttgens <email@hidden>
  • Date: Sun, 13 Dec 2009 13:35:56 +0100

Le 13 déc. 2009 à 00:23:27, email@hidden a écrit :

> 	We have an AppleScript Application Bundle here that checks our Mail accounts at different interval's.  To get it to quit using Cmd-Q, we had to add this code:
>
> ...
> on quit
> 	set theCommand to "ps axuww | grep '" & gScriptName & "' | grep -v grep | awk '{ print $2 }'"
> 	set myPID to do shell script theCommand
> 	do shell script "kill " & myPID
> 	continue quit
> end quit
>
> 	Unfortunately, it refuses to quit when choosing Shutdown or Log Out.  Is there a trick to doing this?  If you need more info, just let me know.

Hello Ted,

It is likely that one of the two do shell script commands fails, perhaps because the target process has already been terminated by the OS (we are at log out time).

A quick and dirty way could be to just enclose those statements within a "try ... end try" block.

But a more reassuring way could perhaps be devised. ;-)
What is/does the process whose name is provided by gScriptName? And how/by who is it launched?

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: Application Bundle won't quit at Shutdown
      • From: email@hidden
References: 
 >Application Bundle won't quit at Shutdown (From: email@hidden)

  • Prev by Date: Re: Missing something obvious
  • Next by Date: Re: Modified "modification date"
  • Previous by thread: Application Bundle won't quit at Shutdown
  • Next by thread: Re: Application Bundle won't quit at Shutdown
  • Index(es):
    • Date
    • Thread