• 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: Detecting Applescript and SKYPE - MORE
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting Applescript and SKYPE - MORE


  • Subject: Re: Detecting Applescript and SKYPE - MORE
  • From: Luther Fuller <email@hidden>
  • Date: Fri, 10 Oct 2008 16:37:46 -0500

On Oct 10, 2008, at 3:09 PM, Don Wieland wrote:

On Oct 10, 2008, at 11:33 AM, Luther Fuller wrote:

	tell application "Finder"
		exists application file id "com.skype.skype"
	end tell

My original script only detects installation, not whether the it's running. There is now a running property, but I couldn't get it to work. A little more experimenting produced this handler, which does work ...


on isRunning(applIdent)
	tell application "Finder"
		try
			set AppName to name of (application file id applIdent)
		on error
			return false
		end try
		if AppName ends with ".app" then
			set AppName to text 1 thru -5 of AppName
		end if
		return exists application process AppName
	end tell
end isRunning

If you want to know if Chess is installed and running, just use ...

	my isRunning("com.apple.Chess")

Why did I use "com.apple.Chess" when I could have simply used ...

	exists application process "Chess"

?

Because some idiot may have changed the name visible in the Finder. Make a copy of the Chess application (it will be named "Chess 2"), launch it, then run the handler above to see how it works.

_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden
  • Follow-Ups:
    • Re: Detecting Applescript and SKYPE
      • From: Sander Tekelenburg <email@hidden>
References: 
 >Re: Detecting Applescript and SKYPE - MORE (From: Don Wieland <email@hidden>)

  • Prev by Date: Re: Detecting Applescript and SKYPE
  • Next by Date: Re: Detecting Applescript and SKYPE
  • Previous by thread: Re: Detecting Applescript and SKYPE - MORE
  • Next by thread: Re: Detecting Applescript and SKYPE
  • Index(es):
    • Date
    • Thread