Re: Script Object Property Persistence
Re: Script Object Property Persistence
- Subject: Re: Script Object Property Persistence
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 23 Sep 2002 08:58:51 -0700
On 9/23/02 8:15 AM, "ken" <email@hidden> wrote:
>
What I have is a script called "CatalogAssets" which has the
>
following in it:
>
>
-- *** begin CatalogAssets script sample
>
>
property scratchDisk:""
>
>
catalogAssestsMain()
>
-- thisDiskName is a string the user has already defined
>
set scratchDisk to thisDiskName
>
end catalogAssestsMain
>
>
-- *** end CatalogAssets script sample
>
>
Naturally, there is much more to it than this, but this is all that's
>
relevant. Now, this script is saved on disk and called from another
>
script in this manner:
>
>
set catalogAssets to load script alias (**path to the saved script
>
object**)
>
catalogAssestsMain() of catalogAssets
>
>
This will correctly load the script and run the handler, but the
>
property scratchDisk resets to "" every time I run the script. What do
>
I have to do to get the property scratchDisk to hold it's value
>
between runs?
You have to store it.
store script catalogAssets in alias (**path to the saved script
object**) replacing yes
'store script' is also in Standard Additions dictionary, just below 'load
script'. Danny Goodman is very good on this stuff. Until you save it in the
script file, you've just been working with an instance of the script in
memory.
--
Paul Berkowitz
_______________________________________________
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.