• 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: How to kill a process using AS
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to kill a process using AS


  • Subject: Re: How to kill a process using AS
  • From: Bernardo Hoehl <email@hidden>
  • Date: Wed, 8 Dec 2004 09:08:34 -0200

Thanks for teaching me Chris.

Your reply was very usefull to me.

Bernardo

++++++++++++++++++
On 07 Dec, 2004, at 9:45 PM, Christopher Nebel wrote:

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:
email@hidden


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: This email sent to email@hidden
References: 
 >How to kill a process using AS (From: Kumar Shailove <email@hidden>)
 >Re: How to kill a process using AS (From: Bernardo Hoehl <email@hidden>)
 >Re: How to kill a process using AS (From: Christopher Nebel <email@hidden>)

  • Prev by Date: Re: Unwinding the containment hierarchy of a reference
  • Next by Date: Re: Smile and FruitMenu
  • Previous by thread: Re: How to kill a process using AS
  • Next by thread: Re: How to kill a process using AS
  • Index(es):
    • Date
    • Thread