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

Re: Load Script


  • Subject: Re: Load Script
  • From: Luther Fuller <email@hidden>
  • Date: Fri, 03 Jun 2011 14:15:06 -0500

The last time I commented on this, about a week ago, I was sure that both the properties and handlers of the calling (parent) script were available in the called (child) script. But, today, when a child script needed a property in the parent, I got an undefined variable error.

When I first said that properties were inherited, I has done experiments confirming that. The experiment scripts have since been trashed.

Today, I searched "AppleScriptLanguageGuide.pdf" for info and found this on page 65 ...

The previous example demonstrates an important point about inherited properties: to refer to an inherited property
from within a child script object, you must use the reserved word my or of me to indicate that the value to which
you’re referring is a property of the current script object. (You can also use the words of parent to indicate that the
value is a property of the parent script object.) If you don’t, AppleScript assumes the value is a local variable.
For example, if you refer to vegetable instead of my vegetable in the changeVegetable handler in the previous
example, the result is "Spinach". For related information, see “The it and me Keywords” (page 40).

So I tried it. Nothing. Using variations on a theme with or without the phrases 'my', 'me' or 'of parent' make no difference at all. OR ... Is there some small item I'm missing?

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Load Script
      • From: Axel Luttgens <email@hidden>
  • Prev by Date: Re: afplay
  • Next by Date: Re: Load Script
  • Previous by thread: AppleScript formatting can help with understanding script problems (was Re: For some strange reason)
  • Next by thread: Re: Load Script
  • Index(es):
    • Date
    • Thread