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

Re: Inheritance dilemma


  • Subject: Re: Inheritance dilemma
  • From: David Graham <email@hidden>
  • Date: Mon, 21 Apr 2003 14:43:32 -0700

On Monday, April 21, 2003, at 10:17 AM, Paul Berkowitz wrote:

Your handler was implicitly declaring a new variable foo with local scope,
which is the default in handlers when no global is explicitly declared. It
is a bit odd that that doesn't take over foo as its own property.

It sure looks like that's what's happening, I can't understand why it's treating the parent's properties as a variables?!?!? In fact, in the scenario that I first posted, I can't seem to set the parent's properties. Changes to any of the parent's properties are treated as local variables and are not persistent. The ASLG says that script libraries are loaded as script objects, but they don't behave like local script objects.

Given the following:

set foo to load script alias "Dave's HD:Users:dgraham:Desktop:foo"

script bar
property parent: foo
end script

--> Can't compile -- error: "The variable foo is not defined."

--------------------------

But, it obviously is defined ...

set foo to load script alias "Dave's HD:Users:dgraham:Desktop:foo"

class of foo

--> "script"

--------------------------

And if you define "foo" in the same script, it does work ...

script foo
property fooBar : "blah"
end script

script bar
property parent : foo
end script

get fooBar of bar

--> "blah"

--

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.

References: 
 >Re: Inheritance dilemma (From: Paul Berkowitz <email@hidden>)

  • Prev by Date: newbie question on simple finder actions
  • Next by Date: Re: newbie question on simple finder actions
  • Previous by thread: Re: Inheritance dilemma
  • Next by thread: Re: Inheritance dilemma
  • Index(es):
    • Date
    • Thread