Re: Settings properties from a loaded script
Re: Settings properties from a loaded script
- Subject: Re: Settings properties from a loaded script
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 08 Jan 2001 12:48:05 -0800
On 1/8/01 12:23 PM, "Bourque, Jason" <email@hidden> wrote:
>
>
I sorry there is a misunderstanding. I want to use the loaded script
>
Variable to set properties in the original script.
set x to loadedScript's theProperty
or:
tell loadedScript to set x to its theProperty
>
>
Why would you want to store the script?
If you want to change the loaded script's property from outside, that's what
you have to do to change it.
I have two active scripts which communicate through a third compiled script
(actually just a script library, with no run handler, but it makes no
difference as long as it's a compiled script rather than an application). In
one of the scripts, the user sets a date and time when he wants a particular
email to be sent in the future. The email message is stored in an OE folder
labeled with the date and time, and another script run on a schedule checks
to see if time is up, and sends it if it is. But the user can also enter a
lot of Preferences in script A that tells script B how to do things
generally. This info is stored in script C. (That ensures that the user
doesn't have a problem if he tries to do this while script B is running:
otherwise it could be done right in script B.) The user can change these
prefs at any time, and the new info is entered by loading script C and
changing one or more of its properties. When script B does its scheduled
run, it first checks script C to see if anything needs to be different from
now on. Ads i say, it could be done with just two scripts, since they are
all compiled scripts anyway, aside from the "busy when running" issue.
So, the short answer, loading, changing, and storing properties in another
script is a way to save and change preferences.
--
Paul Berkowitz