Re: Quit Terminal
Re: Quit Terminal
- Subject: Re: Quit Terminal
- From: Jeffrey Berman <email@hidden>
- Date: Mon, 19 May 2003 12:26:52 -0500
On 5/19/03 5:40 PM, Emmanuel <email@hidden> wrote:
>
I use this, but I never tried to apply it to Terminal:
>
>
----------------------------------
>
on ELKillProcess(theProcess)
>
if theProcess's length > 16 then set theProcess to text 1 thru 16 of
>
theProcess
>
try
>
do shell script (find text "^[[:space:]]*([0-9]+).*" & theProcess & "$" in (do
>
shell script "ps -wxc") using "kill \\1" with regexp and string result)
>
0
>
on error
>
error (theProcess & " was not launched")
>
end try
>
end ELKillProcess
>
----------------------------------
>
>
For brevity this uses "find text" and thus requires either the Satimage osax
>
or Smile (free software).
Why not just use 'killall'? As in:
do shell script "killall " & theProcess
-Jeff Berman
_______________________________________________
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.