Re: Application Bundle won't quit at Shutdown
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