Monday, December 11, 2017

#1 2002-02-02 11:35:38 am

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

AS Studio: saving preferences / properties

How do you save preferences in AppleScript Studio?
One of the nice things about AppleScripts was that they retain their properties from launch to launch, without the need for separate preference saving routines.
Is there any easy way to save all the properties in AS Studio? Or a routine someone has already written to save and load properties to and from a plist (I thought that is what plists are for, and no, i don't know XML).
Here's a trial routine. The my_val property is not retained between launches.
Pls help on this one.
try this routine:
-- Application.applescript property my_val : "Original Value"
on launched theObject
set contents of text field "textbox" of window "Main" to my_val
display alert "The value is:" message my_val default button "Whoakay"
end launched
on will quit
set my_val to (contents of text field "textbox" of window "Main")
display alert "Setting my_val to " message my_val end will quit


One mans trash is another mans treasure

Offline

 

#2 2002-02-02 01:26:11 pm

Rob
Member
From:: Ohio, USA
Registered: 2002-11-20
Posts: 1886

Re: AS Studio: saving preferences / properties

: How do you save preferences in AppleScript Studio?
: One of the nice things about AppleScripts was that they retain
: their properties from launch to launch, without the need for
: separate preference saving routines.
: Is there any easy way to save all the properties in AS Studio? Or
: a routine someone has already written to save and load
: properties to and from a plist (I thought that is what plists
: are for, and no, i don't know XML).
I don't have OS X, or AppleScript Studio, but I'm subscribed to
Apple's Studio list. From what I've gathered, everyone needs
to get in the habit of writing preferences to a file and I believe
XML is the suggested format.
I've included a link to the mailing list page. From there, you can
gain access to the archives and possibly find a definitive
answer in case it doesn't show up here. :-)
Is there any reason why you can't write the prefs to a file in the
regular AppleScript manner?
Sorry I can't offer more.
-- Rob

Offline

 

#3 2002-02-02 04:50:14 am

Trash Man
Sanitation Department
Registered: 2005-10-20
Posts: 5336

Re: AS Studio: saving preferences / properties

: Is there any reason why you can't write the prefs to a file in
: the regular AppleScript manner?
well in theory you could. but what a pain! you didn't have to write out properties in AppleScript, it remembered them in the script (I actually never understood where they were saved, but they were saved).
I mean if you DO have to write out and read in prefs in an AS application, why should everyone re-invent the wheel? Just one subroutine to somehow go through every property and save them into XML. Unfortunately that is beyond me.


One mans trash is another mans treasure

Offline

 

Board footer

Powered by FluxBB

RSS (new topics) RSS (active topics)