Is there a way to prevent a script from asking for the location of an application the user does not have?
The Moa Tunes project I’m working on will use Entourage X and Eudora X if available. I have all calls to these apps in If … then blocks which only execute if the user choses to use these features. But the script asks for the location of these applications on launch anyway.
If a tell command to the app is executed, then it would make sense to ask for the location, but if that tell block is never reached?
Is there a work around?
Thanks.
: Is there a way to prevent a script from asking for the location
: of an application the user does not have?
: The Moa Tunes project I’m working on will use Entourage X and
: Eudora X if available. I have all calls to these apps in If
: … then blocks which only execute if the user choses to use
: these features. But the script asks for the location of these
: applications on launch anyway.
: If a tell command to the app is executed, then it would make
: sense to ask for the location, but if that tell block is never
: reached?
: Is there a work around?
The compiler needs to use the dictionary from each application in order to compile commands directed to it. If it can’t find the application it can’t compile. At run time it assumes it needs each of these applications in order to run.
The workaround it the “using terms from” command that allows you to use a variable name instead of the actual application name in the tell statement. In older versions of AppleScript that don’t have “using terms from” there is a “double tell” technique that does the same thing. You can find details about this on Bill Cheeseman’s AppleScript Sourcebook site.
Marc K. Myers
Marc@AppleScriptsToGo.com
AppleScriptsToGo
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[02/14/2002 12:41:59 PM]