Re: Inheritance and Loaded Libraries
Re: Inheritance and Loaded Libraries
- Subject: Re: Inheritance and Loaded Libraries
- From: Axel Luttgens <email@hidden>
- Date: Sun, 31 Oct 2004 13:18:30 +0100
has wrote:
[...]
If there's an interesting question here, it's why 'tell my XLib to
runTest()' should have worked? In fact, this approach just blows up
further down the line, so isn't really a solution at all, e.g. the
following will give a "<<script>> doesn't understand the sayThing
message" error:
Exhibit 2 - The Script Library: A Compiled Script
on runTest()
sayThing()
end runTest
on sayThing()
say "a Lib"
end sayThing
Well, yes and no.
It seems that there is again some kind of missing initialization (which
would have been dynamically provided in a true delegation context).
With above Exhibit 2, one just need to write Exhibit 3 as:
Exhibit 3
script myScript
tell (get my XLib) to runTest()
end script
tell application "ScriptRunner" to runScript(myScript)
With that intermediary "get", the "tell" now targets a script object
that does understand the "sayThing" message (one could even write a
sayThing that calls a sayThing2 ... that calls a sayThingN; ie, the
target now fully behaves as a script object).
Short response: the OP should use one or other of the two solutions I
provided, and not rely on bugs in AppleScript to make things sorta
work when they shouldn't.
That the OP went with scoping instead of going thru the object chains as
intended with AppleScript's language, I agree.
But in what sense should there be bugs?
That the compiler allows to enter 'tell my XLib to runTest()'?
That the interpreter chokes upon execution of that statement?
Could you be more precise, as it was the first time in the thread that
the idea of bugs appeared?
Axel
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden