Re: How to kill a process using AS
Re: How to kill a process using AS
- Subject: Re: How to kill a process using AS
- From: Christopher Nebel <email@hidden>
- Date: Tue, 7 Dec 2004 15:45:06 -0800
On Dec 7, 2004, at 11:42 AM, Bernardo Hoehl wrote:
property Thereis : false
tell application "System Events"
set TheList to get name of every process
repeat with i from 1 to the count of TheList
if item i of TheList contains "iSync" then
set Thereis to true
end if
end repeat
end tell
Why, oh why, do people do this? It's complicated and inefficient. Use
this instead:
tell application "System Events"
set Thereis to exists process "iSync"
end tell
(Technically, this is not the same thing as the original, but it's
probably what Bernardo actually meant. To make them truly equivalent,
you'd have to say 'exists process whose name contains "iSync"'.)
Incidentally, as of 10.3, telling an application to quit won't launch
it if it's not already running, so you could just say 'tell application
"iSync" to quit' and not worry about it.
--Chris Nebel
AppleScript Engineering
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden