• 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
Inheritance dilemma
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Inheritance dilemma


  • Subject: Inheritance dilemma
  • From: David Graham <email@hidden>
  • Date: Mon, 21 Apr 2003 09:35:45 -0700

While John D. was assisting me with a script object as a storage for preferences, I got off on a bit of a tangent. Basically (if I understand it correctly), JD recommended storing, retrieving, and writing to the prefs as a record in the library file. I still think it should be as easy as retrieving the individual properties directly from the parent script object, but can't figure out why it doesn't work like I'd expect.

For instance:

(Given a script library 'libTest' with the following property)

property foo : "bar"


When I execute the following, it functions as I would expect:

-- EXAMPLE 1

property parent : load script alias "Dave's HD:Users:dgraham:Desktop:libTest"

get foo

--> "bar"




So if the parent script's properties are treated as it's own, why don't the handlers inherit them as well?

-- EXAMPLE 2

property parent : load script alias "Dave's HD:Users:dgraham:Desktop:libTest"

TestInheritance()

to TestInheritance()

get foo

end TestInheritance

--> Error "The variable foo is not defined."


TIA!

- Dave


--

david m graham
619.322.9698
http://homepage.mac.com/davidgraham/
_______________________________________________
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.

  • Follow-Ups:
    • Re: Inheritance dilemma
      • From: Paul Berkowitz <email@hidden>
  • Prev by Date: Re: [Q] Automatic Finder Icon Placement
  • Next by Date: Re: Read file bug?
  • Previous by thread: Re: Path to current script file?
  • Next by thread: Re: Inheritance dilemma
  • Index(es):
    • Date
    • Thread