Re: Check if app exists
Re: Check if app exists
- Subject: Re: Check if app exists
- From: has <email@hidden>
- Date: Sun, 23 Sep 2007 18:52:25 +0100
Jeremy Matthews wrote:
Tried the remaining AppleScript-based solutions...none can avoid
getting the dreaded "Where is app...." dialog.
While it's a pain in the butt to have to jump through all the hoops,
as long as you follow the techniques provided by Jon and/or myself to
1. check if GrowlHelperApp is installed, and 2. avoid 'application
"GrowlHelperApp"' literals, you should not get a 'Where is app...'
dialog unless you're compiling the script from source or executing
the part of the code that sends commands to GrowlHelperApp.
[aside]
Incidentally, you never get any of these hassles when using Python/
Ruby/ObjC + appscript. Unlike AppleScript, appscript doesn't do
anything unless/until you actually execute code that refers to that
application. e.g.:
# some code...
GHA = app('GrowlHelperApp') # create an application object for
(possible?) later use
# more code...
# appscript does nothing up to this point
GHA.notify(...) # appscript finds the application and launches it if
necessary
# rest of code...
If appscript doesn't find the specified application then it raises an
'application not found' error, allowing you the developer to decide
what, if anything, your script should do next (skip the code in
question, prompt the user to locate the application, quit, etc).
A further bonus is that appscript allows you to specify applications
by creator type, bundle ID or process ID in addition to the usual
name, path or URL. This gives you lots of flexibility in how you
locate applications - particularly useful if their filenames may
occasionally change (e.g. due to containing version numbers), or if
you need to run multiple instances of the same application side by side.
[/aside]
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