Re: How to "Tell" a varible name
Re: How to "Tell" a varible name
- Subject: Re: How to "Tell" a varible name
- From: SeaSoft Systems <email@hidden>
- Date: Wed, 7 Feb 2001 14:45:32 -0800
At 13:04 -0800 2/7/2001, Marc K. Myers wrote:
The problem is that at compile time AppleScript doesn't know which
application's it should be looking at for the "inner meaning" of the
commands. That's why this technique only works with commands that are
common to all applications.
What you need to do is simple, since the application will always be the
same one.
tell application file ID "WWW "
[Do Stuff]
end tell
or
tell application "Webstar 4.4b2"
tell application WebStar
[Do Stuff]
end tell
end tell
The commands will always go to an active process before they'd go to an
application file, so the former syntax is probably what you need.
The problem I am having is that the version numbers of the
application I want to script are changing frequently (i.e., "Webstar
4.4b1", "Webstar 4.4b2", etc.) They all have the same creator code
and the same applescript dictionaries, but they are physically
different applications. I always want the script to target to
whichever one is running when the script fires, that is, the single
finder process whose creater code I have given "WWW*"
In this situation the "double tell" method seems to fail in general
since whichever version of the App was used at applet compile time
gets loaded when the script is run, in addition to the App version
that is actually running, which can be different. Having two versions
of the same app running at the same time creates a huge problem, as
you can imagine (it is a server in this case).
I had hopes that something simple like
tell application file ID "WWW "
[Do Stuff]
end tell
would work, and was ecstatic to see this offered as a solution.
Sadly, it won't compile on my machine (OS8.6), even though an
application with the appropriate creator code is an active process.
Is there another syntax, perhaps within a finder tell block, that
might work?
It seems (to the newbie :-) like it should be a simple matter to
target a script to an application with known creator code, which App
is known to be up and running when the script is run, and is known to
be the *only* application with that code that is running, but I can't
get anything to work.
Any other thoughts?