Re: Saving property values over changes to script
Re: Saving property values over changes to script
- Subject: Re: Saving property values over changes to script
- From: Andrew Oliver <email@hidden>
- Date: Wed, 26 Mar 2003 02:07:44 -0800
On 3/26/03 12:51 AM, "email@hidden" <email@hidden>
wrote:
>
Now if you edit the script you lose the current values of the properties?
Yes. When you edit a script, all properties get reset to the default values.
>
I'm assuming so. Is there a neat way to save and restore these property
>
values over editing the script? I'm tempted to manually save and restore to
>
a file as I can then inspect and edit the values outside the script.
There's several ways of doing this. One is to have a separate script that
contains the list of properties. You can then use load script to load the
properties into your script:
--script 1 - properties file
property someString: "abcdefg"
-- script 2 - real script
--load the properties
set propsScript to load script "path:to:script"
-- read a property
set myProp to someString of propsScript --> "abcdefg"
-- set a property's value
set propsScript's someString to "gfedcba"
-- save the properties file
store script propsScript in file "path:to:script"
_______________________________________________
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.