Re: Fastest way to read and set variables from a prefs file?
Re: Fastest way to read and set variables from a prefs file?
- Subject: Re: Fastest way to read and set variables from a prefs file?
- From: Malcolm Fitzgerald <email@hidden>
- Date: Tue, 28 May 2002 23:52:13 +1000
this may not be the fastest way but it hasn't failed yet, and it is
used often by dozens of scripts, so it runs hundreds of times a day.
It allows all users on a network to keep individual prefs, while
maintaining a default set. It requires RecordAccess OSAX.
-- read prefs
tab delimited name/value pairs, one to a line in a plain text file
I read them in
I split the string on CRs
I loop through the list splitting on TABs
I generate a record with the results using RecordAccess
I return the record
-- records allow me to say:
archive_folder of script
user_name of script
password of script
I rarely need to set the prefs, so I use a FMPro database to store
the defaults and modify prefs now. I allows me to run the db across
the network, reset defaults or modify prefs and set them, etc. But
it's not fast, all the UI makes it very slow - one or two minutes
from go to whoa. On the up-side, it is easy to talk someone through
the process over the phone. And because almost everything I do has a
Filemaker database in it there's no extra overhead.
Hello,
Anyone have a fast way of reading and setting variables from a text prefs
file?
Things to consider.
TIDS - Might be the fastest if file is deliminated with a unique string.
Could multiple projects be in the same preference file?
I currently read the text file and repeat thru each line matching it up to a
variable string and then setting the related variable. Each one uses an
offset command taking even more time.
A line in the text file might look like this.
Move with replacing ~ Yes
I would appreciate any input on this.
Thanks,
Jason Bourque
Co-Director Boston AppleScript Users Group
_______________________________________________
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.
--
--
Malcolm Fitzgerald email@hidden
Database Manager
http://www.asauthors.org
The Australian Society of Authors ph: 02 93180877 fax: 02 93180530
_______________________________________________
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.