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

load script question


  • Subject: load script question
  • From: "Jason W. Bruce" <email@hidden>
  • Date: Fri, 29 Jun 2001 13:33:27 +0000

Loading the script as a parent will also execute the run handler of the
loaded script without a "tell foo to run" statement.

property parent: load script alias "Dora:set x"


Jason Bruce

> From: email@hidden
> Reply-To: email@hidden
> Date: Thu, 28 Jun 2001 19:46:08 -0700 (PDT)
> To: email@hidden
> Subject: applescript-users digest, Vol 2 #818 - 15 msgs
>
> Message: 4
> Date: Thu, 28 Jun 2001 16:42:15 -0400
> From: Victor Yee <email@hidden>
> Subject: Re: load script question
> To: applescript-users <email@hidden>
>
> On Thu, 28 Jun 2001 15:43:07 -0400, I wrote,
>
>> On Thu, 28 Jun 2001 11:02:52 -0700, Michelle Steiner wrote,
>>
>>> property loaded_script : alias "Dora:set x"
>>> set foo to load script loaded_script
>>> x
>>
>> Loading a script does not include running it. Add a "tell foo to run" and you
>> should get your expected results.
>
> That sounded rather abrupt... sorry. Telling foo to run will execute its code
> since "set x to 10" is in an implied run handler. Note that this will set the
> x of the main script. Without running foo, you get the "not defined" error
> since the main script's x hasn't been assigned a value.
>
> Re-reading your post and thinking a little furthur, were you expecting x to be
> a property of foo? If so, then you would need to declare it as a property in
> the script to be loaded. Since foo doesn't have an x, you get the "Can't make
> some data..." error.
>
> Victor


  • Prev by Date: AOL 5.0 script
  • Next by Date: Changing properties?
  • Previous by thread: Re: load script question
  • Next by thread: Re: load script question
  • Index(es):
    • Date
    • Thread