Re: Calling an application
Re: Calling an application
- Subject: Re: Calling an application
- From: "Marc K. Myers" <email@hidden>
- Date: Sat, 10 Feb 2001 04:38:39 -0500
- Organization: [very little]
>
Date: Sat, 10 Feb 2001 18:17:05 +1300
>
Subject: Re: Calling an application
>
From: Andrew Wylie <email@hidden>
>
To: <email@hidden>
>
>
> From: "Marc K. Myers" <email@hidden>
>
> Subject: Re: Calling an application
>
>
>
> Find out what the signature (Creator Type) for Apple Software Restore
>
> is. For this example we'll say it's "ASRe". Than call the app like this:
>
>
>
> tell application "Finder"
>
> set appPath to application file id "ASRe" as string
>
> set appName to name of application file id "ASRe"
>
> end tell
>
> launch application appPath
>
> tell application "Apple Software Restore"
>
> tell application appName
>
> [Do Stuff]
>
> end tell
>
> end tell
>
>
>
> For a number of reasons, the system can find it hard to locate a program
>
> by its name. It can (almost) always find it by it's signature. The
>
> extra layer of "tell...end tell" with the application's name is there so
>
> the compiler can know what application it's compiling the commands for.
>
> It should have no effect at run time.
>
>
I can't see the point of this Marc and it seems to defeat the purpose
>
asking for the app at 'tell application "Apple Software Restore"'
>
why not?
"The extra layer of "tell...end tell" with the application's name is
there so the compiler can know what application it's compiling the
commands for. It should have no effect at run time."
If you try to "tell" a variable and the commands you use are anything
other than the commands that are common to all applications, the script
won't compile. The compiler needs to go to an application's dictionary
in order to understand what it's trying to compile. The outer layer of
"tell" provides that access at compile time. The inner layer directs
the commands to the actual process that's running at run time.
Do you see the point now? You can have any version of the application
with any name installed on the computer that's running the script and it
will still work as long as the application has the right creator code.
Marc K. Myers <email@hidden>
http://AppleScriptsToGo.com
4020 W.220th St.
Fairview Park, OH 44126
(440) 331-1074
[2/10/01 4:35:36 AM]