Funny (obscure) 'using terms from' usage
Funny (obscure) 'using terms from' usage
- Subject: Funny (obscure) 'using terms from' usage
- From: Harald E Brandt <email@hidden>
- Date: Sun, 29 Sep 2002 17:19:54 +0200
Chris Nebel once said that 'using terms from' and then saving as
run-only would make the script app work also on pre-OS 9 without the
dreadful "where is app ...", since it is only used during
compile-time.
However, I have found that if it is placed within a handler, it
doesn't work at all as claimed. But, if I put the 'using terms'
OUTSIDE the handler, it does miraculously work! Examples to explain:
As an example, take this routine for using AppleScript Output, which
my installer places in the users scripting additions folder. To make
its usage easy in many places, we place it in a handler thus:
property ASOpath : ""
set ASOpath to ((path to scripting additions as string) & "AppleScript Output")
ASO("message", 1) --Somewhere in the script app
on ASO(infoText, cmd) --cmd is 0 for no activation, 1 for making it active
using terms from application "AppleScript Output"
tell application ASOpath
if cmd is 1 then activate
if infoText is not "" then display infoText as string
end tell
end using terms from
end ASO
The above thing, saved as run-only, will NOT work in OS 8.6 without
the dreadful dialog "where is..."!
However, if the routine above is replace by this:
using terms from application "AppleScript Output"
on ASO(infoText, cmd) --cmd is 0 for no activation, 1 for making it active
tell application ASOpath
if cmd is 1 then activate
if infoText is not "" then display infoText as string
end tell
end ASO
end using terms from
Then the thing works whithout getting the dreadful dialog!?
But to me, it looks ridiculous to have 'using terms' outside the handler!
Is that really right?
And why is this behavior?
Also, what do I do if I need a large handler with several such things?
I can't really enclose big handlers with a bunch of 'using terms from', can I?
__________________________BragIt___________________________
Harald E Brandt email@hidden
http://bragit.com
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.