Re: initialising loaded scripts
Re: initialising loaded scripts
- Subject: Re: initialising loaded scripts
- From: Arthur J Knapp <email@hidden>
- Date: Fri, 03 May 2002 14:31:31 -0400
>
Date: Fri, 03 May 2002 08:42:54 -0700
>
Subject: Re: initialising loaded scripts
>
From: Paul Berkowitz <email@hidden>
>
My head's going around in circles here, Arthur. What does this accomplish,
>
in the end?
Oh, you wanted a "useful" example. ;-)
>
... Which script has its properties set? The loaded script "Stuff to
>
remember"? Or the main script?
I'm not sure I understand what you mean. The main script has loaded
a compiled script called "Stuff to Remember". It treats the loaded
script exactly the same way it would treat a hard-coded script object:
-- in Main Script
--
if ( mainScriptCompileDate of StuffToRemember is [whatever] ) then
...
It is just a lot more convenient to load generic scripts rather than to
have to cut & paste source code all the time.
>
What would be the advantage of doing this
>
within the property declaration of the main script?
When there is a need to have very large or complicated data structures
"ready to go" when a script is run, it is often convenient to have them
compiled directly into a script rather than to set/generate each time the
script is run. Even if they are not large or complex, it is still
convenient to have a generic script object "set" it's internal properties
based on a particular main script's needs:
-- script "Main Script"
--
property myBigIntegerList : MakeIntegers(1, 5000) of load script ...
property PreSizedListObject : PreSize(30000) of load script ...
property LookupObject : Initialise( {"first name", "Arthur} ) of ...
property RgbColorObject : DefaultColor( "#00AAFF" ) of load script...
{ Arthur J. Knapp, of <
http://www.STELLARViSIONs.com>
<
mailto:email@hidden>
try
<
http://members.bellatlantic.net/~bswaldie/>
on error number -128
end try
}
_______________________________________________
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.