Re: Check if app exists
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