• 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: Getting a PID and killing a process (Was: Re: Scripting a command to unix..)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting a PID and killing a process (Was: Re: Scripting a command to unix..)


  • Subject: Re: Getting a PID and killing a process (Was: Re: Scripting a command to unix..)
  • From: Christopher Nebel <email@hidden>
  • Date: Sun, 17 Mar 2002 12:26:22 -0800

On Saturday, March 16, 2002, at 03:10 PM, Hiram wrote:

I am looking for a way to use a shell script to get the PID of a faceless process (wget) and then kill it, all from within a script.

It seems..

tell application "wget" to quit

..won't work, and neither does giving the full path to wget. Any help is appreciated.

As others have described, you need to use a combination of "ps" and "kill" in a "do shell script" command to do this. However, it's an interesting problem.

Your initial solution, tell app "wget" to quit, didn't work because wget is written using only BSD Unix APIs, and therefore doesn't understand Apple events at all. However, you could argue that all applications, even things like wget, should at least understand "run" and "quit" -- they have the concepts, they just may not know about Apple events. I've written a feature request.


--Chris Nebel
AppleScript Engineering
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

References: 
 >Getting a PID and killing a process (Was: Re: Scripting a command to unix..) (From: Hiram <email@hidden>)

  • Prev by Date: Re: Open files
  • Next by Date: theSIMS -- Applescript copy paste from Explorer
  • Previous by thread: Re: Getting a PID and killing a process
  • Next by thread: Scripting a command to unix with sudo fun
  • Index(es):
    • Date
    • Thread