Re: Persistence of Properties
Re: Persistence of Properties
- Subject: Re: Persistence of Properties
- From: Jolly Roger <email@hidden>
- Date: Mon, 15 Oct 2001 15:02:13 -0500
On 10/15/2001 1:28 PM, "Paul Skinner" <email@hidden> wrote:
>
> Is there a relatively easy way to specify that the properties are to be
>
> saved in a file other than the script itself ? One way would be to loop
>
> through the properties themselves, but I'm hoping for something simpler.
Hi Irwin,
I use Akua Sweets "save resource" command to store my properties in the
resource fork of a preferences file like so:
save resource allData in file plugDataFile of type "data" numbered 1
I use these Akua Sweets commands to make the file a preferences file:
set basicInfo to basic info for file plugDataFile
set the file creator of basicInfo to "hmmm" -- my creator code
set the file type of basicInfo to "pref" -- pref file type code
apply catalog info basicInfo to file plugDataFile
Then I retrieve the data from the file like so:
set allData to the resource of type "data" as list in file plugDataFile
numbered 1
To store multiple properties, just increment the resource number for each
property (save resource...numbered x, or the resource...numbered x). Another
way to store multiple properties would be to create a list to hold all of
the properties and then store the list into the resource. Whatever floats
your boat. ;)
HTH
JR