Re: circumventing the "where is" dialog
Re: circumventing the "where is" dialog
- Subject: Re: circumventing the "where is" dialog
- From: "Bob.Kalbaugh" <email@hidden>
- Date: Wed, 07 Nov 2001 19:52:21 -0500
on 11/7/01 3:18 PM, John Fountain at email@hidden wrote:
>
Hi all-
>
>
I'm interested to know if there is anyone who has ever tried to test for
>
the existence of an application before the "Where is.. application"
>
dialog appears. Example. A script needs FileMaker Pro but it's not
>
installed on a users machine. Instead of the script asking "Where is
>
FileMaker?" I would like to query the machine to see if FileMaker is in
>
the Desktop DB of the machine and if it's not there I want to provide an
>
error message telling the user so. I'm not sure this is possible though.
>
Any ideas?
>
>
Thanks
>
>
-John
One way is to have the Finder look for the application file's unique ID. for
example:
--
tell application "Finder"
set appToFind to (exists application file id "FMP5")
end tell
if appToFind then
--do something here
display dialog "It's there!"
else
-- do something else here
display dialog "It ain't there :-("
end if
--
Some common apps & ID's:
-- QuarkXPress = XPR3
-- Adobe Ilustrator = ART5
-- Adobe Photoshop = 8BIM
-- AppleWorks = BOBO
-- Netscape = MOSS
-- Adobe Acrobat = CARO
-- Adobe Distiller = DSTL
-- FileMaker Pro = FMP5
-- SimpleText = ttxt
-- Tex-Edit Plus = TBB6
-- Fetch = FTCh
Just remember that they are strings, so you need the quotation marks.
and...
Here's one way to check to see if an app is currently running:
--
tell application "Finder"
set quirkRunning to (creator type of processes contains <<class XPR3>>)
end tell
if quirkRunning then
--do something here
display dialog "It's running!"
else
-- do something else here
display dialog "It ain't running :-("
end if
(*
note the double less than greater than symbols should really be chevrons,
obtained by typing option-backslash for left chevron ;
option-shift-backslash for right chevron, however, the listserve mangles
chevrons.
*)
--
HTH - Have fun!
bob.kalbaugh