Hi, in witch way can I save some settings infos of my script?
Hey Otto,
I think you can store settings into the script itself, using
script.preferences.xxxx
where xxxx is the name of the entry.
For example, to store and reuse a value "steps" (which can be altered by the user via dialog), try something like this:
var steps = 10;
if (script.preferences.stprefs) steps = script.preferences.stprefs;
var values = { iteration: steps, ... };
var components = { iteration: { type: number, label: 'count' }, ... };
values = Dialog.prompt('MyScript', components, values);
if (values) {
script preferences.stprefs = values.iteration;
}
Wolfgang
thanks pqbd ... that's useful to know.
My question above was about where 'script.preferences' is stored - being passed between multiple illustrator files.
I have not been able to track it down in the Windows registry or any of the common folders ( I looked at all files created 'today' for instance).
OK - solved for Windows.
For each script it's in Registry with key =
HKEY_USERS\<userkey>\Software\JavaSoft\Prefs\com\scriptographer\preferences\scripts\/Scriptographer /Scripts\<foldername>\<scriptname>
No idea why it didnt show up in a previous regedit search:-(
Will need a bit of a nasty script to extract that for porting to another machine.