• 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: stopping an application
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: stopping an application


  • Subject: Re: stopping an application
  • From: Arjun SM <email@hidden>
  • Date: Mon, 13 Apr 2009 12:25:05 +0530

Use the 'do shell script' command
do shell script kill -9 PID
That should work.


On Mon, Apr 13, 2009 at 10:08 AM, James W. Walker <email@hidden> wrote:

>
> On Apr 12, 2009, at 8:55 PM, Greg Guerin wrote:
>
>  Bill Janssen wrote:
>>
>>  I was afraid of that...  Is there an easy way to do that from the
>>> command line given its PID?
>>>
>>
>> Use the osascript command.
>>
>> Form a query using a 'whose' clause to select the process ID.  I forget
>> what the exact wording is, or whether to ask Finder or System Events, so
>> you'll have to experiment.  To start, open the scripting dictionary of
>> System Events and under its Processes Suite, choose the 'process' class and
>> find its 'unix id' property.  That's the thing you need to use in a 'whose'
>> clause.
>>
>> Then tell that application to quit.
>>
>
> This works to quit an app with PID 902:
>
> tell app "System Events" to set x to file of first process whose unix id is
> 902
> tell app (POSIX path of x) to quit
>
> I'm no AppleScript expert, so there's probably a briefer or more elegant
> way to do it.
>
> Hmm, now what did this have to do with Cocoa?
>
>
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
>
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: stopping an application
      • From: Andrew Farmer <email@hidden>
References: 
 >Re: stopping an application (From: Greg Guerin <email@hidden>)
 >Re: stopping an application (From: "James W. Walker" <email@hidden>)

  • Prev by Date: Re: Best way to pass large objects between tasks?
  • Next by Date: Re: stopping an application
  • Previous by thread: Re: stopping an application
  • Next by thread: Re: stopping an application
  • Index(es):
    • Date
    • Thread