• 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: Check if app exists
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Check if app exists


  • Subject: Re: Check if app exists
  • From: has <email@hidden>
  • Date: Thu, 20 Sep 2007 17:21:53 +0100

Jeremy Matthews wrote:

I have the following basic code:

tell application "Finder"
		if application "GrowlHelperApp" exists then
			set growlexists to "true"
		end if
end tell

I do not think that code does what you think it does. It's telling AppleScript to send an 'exists' event to GrowlHelperApp. (BTW, any result you may get back is completely meaningless for reasons I won't bother going into.)


I think what you want is to call LaunchServices' LSFindApplicationForInfo function which can locate an application by name, bundle ID and/or creator type and will return an error if the application isn't found:

http://developer.apple.com/documentation/Carbon/Reference/ LaunchServicesReference/Reference/reference.html#//apple_ref/c/func/ LSFindApplicationForInfo

Easy enough to wrap it in an osax or ObjC class (if it's a Studio- based project) if you don't mind doing a little C.

HTH

has
--
http://appscript.sourceforge.net
http://rb-appscript.rubyforge.org

_______________________________________________
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
  • Prev by Date: Re: Exporting shell variables to AppleScripts
  • Next by Date: Re: Check if app exists
  • Previous by thread: Re: Check if app exists
  • Next by thread: Re: Check if app exists
  • Index(es):
    • Date
    • Thread