Re: Saving lists of records to a text file
Re: Saving lists of records to a text file
- Subject: Re: Saving lists of records to a text file
- From: JollyRoger <email@hidden>
- Date: Sun, 26 May 2002 13:51:35 -0500
On 5/25/2002 2:56 AM, "Landis" <email@hidden> wrote:
>
Please forgive what I hope is an easy question. I'm just not sure
>
how to go about this.
>
>
I've got a list of records that I get out of FileMaker Pro. It's a
>
little slower than snot at about 20 minutes when I want to refresh
>
that list. The question is: is there a way to save these lists of
>
records to a file so that I can just open that again if I know the
>
data in the FMP database hasn't changed since the list of records was
>
last generated?
>
>
For instance in FMP I've got a couple fields and a couple records so
>
when bringing it into AppleScript I generated a record for each FMP
>
record and put together a list of those.
>
>
{{Field1:"Data1",Field2:"Data2"},
>
{Field1:"Data3",Field2:"Data4"}}
>
>
Actually it's a bit more complicated (lists within records within
>
lists within... you get the point) so I'm at a lost to see how I
>
could just save this to a text file and read it back in fairly
>
easily. Any tricks I'm missing?
Must it be a text file? Do you care about the format of the file, or do you
just simply want to be able to restore the data in your script when you need
access to it again? If the latter is the case, consider the following:
I use the following method to store data between loads of various plugins.
My main script saves the data (a global property) as a resource into a prefs
file before unloading the plugin. Then when the main script loads the
plugin the next time, it reads the data from the resource in the prefs file
into the property:
-- save the data
save resource myData in file plugDataFile of type "data" numbered 1 -- Akua
Sweets
set basicInfo to basic info for file plugDataFile -- Akua Sweets
set the file creator of basicInfo to "mine" -- Akua Sweets
set the file type of basicInfo to "pref" -- Akua Sweets
apply catalog info basicInfo to file plugDataFile -- Akua Sweets
-- read the data
set myData to the resource of type "data" as list in file plugDataFile
numbered 1 -- Akua Sweets
This allows my plugin data to persist between loads/runs.
HTH
JR
_______________________________________________
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.