• 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: Killing an appleScript applet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Killing an appleScript applet


  • Subject: Re: Killing an appleScript applet
  • From: Emmanuel LEVY <email@hidden>
  • Date: Fri, 30 May 2014 14:41:14 +0200

Great Ed found a solution, but I note that Ed's original post was about using killall, which kills by name, and replies were about kill, which require the pid.

I think that killall makes a simpler solution, like in:

do shell script "killall RunningScript.app"

Best,
Emmanuel

On May 30, 2014, at 1:14 AM, Shane Stanley wrote:

> On 30 May 2014, at 6:11 am, Stockly, Ed <email@hidden> wrote:
>
>> set appletName to "RunningScript.app"
>> set processToKill to ""
>> set processList to do shell script "ps -x"
>> repeat with thisProcess in paragraphs of processList
>>    if thisProcess contains appletName then
>>        set processToKill to thisProcess as text
>>        set PID to word 1 of processToKill
>
> FWIW, System Events can give you the PID directly:
>
> tell application "System Events" to set pid to unix id of process "Safari"
>
> --
> Shane Stanley <email@hidden>
> <www.macosxautomation.com/applescript/apps/>
>
> _______________________________________________
> 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


 _______________________________________________
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


References: 
 >Re: Killing an appleScript applet (From: "Stockly, Ed" <email@hidden>)
 >Re: Killing an appleScript applet (From: Shane Stanley <email@hidden>)

  • Prev by Date: Re: Killing an appleScript applet
  • Next by Date: Re: Killing an appleScript applet
  • Previous by thread: Re: Killing an appleScript applet
  • Next by thread: Re: Killing an appleScript applet
  • Index(es):
    • Date
    • Thread