Re: solutions to scripting addition terminology confilicts
Re: solutions to scripting addition terminology confilicts
- Subject: Re: solutions to scripting addition terminology confilicts
- From: email@hidden
- Date: Fri, 25 Jan 2002 14:01:23 -0500
On Mon, 21 Jan 2002 01:02:42 -0800, "Neal A. Crocker" <email@hidden>
suggested,
>
I propose three alternative solutions to the problem of scripting
>
addition terminology conflicts.
>
>
Solution 1: The introduction of a "using module" block and a
>
"Scripting Modules" folder.
I think you might be able to do such a thing using an ordinary "using terms
from..." block, by defining a terminology-only application. (I've previously
used a terminology-only Scripting Addition to blatenly pollute the global
namespace, so this approach will restore my karmic balance.) Now, I haven't
tested any of this, but I think it ought to work.
To produce a 'module', which will have limited terminology scope but have the
response speed of a Scripting Addition, break the Scripting Addition into two
pieces. Piece 1 is the Scripting Addition less its terminology, and Piece 2 is
the terminology. (Call them osax-code and osax-terminology for now.)
The file osax-code is still a scripting addition, but it doesn't introduce terms
into the global name space. Normally, you'd have to call it with raw event
syntax
<<event fooobaar>> given <<class xyzz>> 42
But now, wrap this in a
tell application "osax-terminology"
end tell
block, or a "using terms from" block, and you can use the terminology that
replaces the raw codes.
(On further thought, I think it would be best to use 'using terms from' and not
'tell', because the Apple event has to be sent to the script's own process, and
not to the process created by running "osax-terminology" . In the second case,
you'd be switching processes, and then the "osax-terminology" process would call
the "osax-code" scripting addition. You might as well just make it a Faceless
Background Application then.)
Testing this, and telling me why it won't work, is left as an exercise for the
reader....
--
Scott Norton Phone: +1-703-299-1656
DTI Associates, Inc. Fax: +1-703-706-0476
2920 South Glebe Road Internet: email@hidden
Arlington, VA 22206-2768 or email@hidden