• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Inheritance and Loaded Libraries
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Re: Inheritance and Loaded Libraries (From: has <email@hidden>)

  • Prev by Date: Re: Inheritance and Loaded Libraries
  • Next by Date: Re: Inheritance and Loaded Libraries
  • Previous by thread: Re: Inheritance and Loaded Libraries
  • Next by thread: Re: Inheritance and Loaded Libraries
  • Index(es):
    • Date
    • Thread