Sg2.9
Save settings into a file
Recent RSS
Save settings into a file
From:  Otto Climan
Date:  5. August 2012, 10:33

Hi, in witch way can I save some settings infos of my script?

Re: Save settings into a file
Date:  7. August 2012, 09:35

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

Re: Save settings into a file
Date:  7. August 2012, 21:30

I'd like a clue as to where this is stored so I can move it between machines - or generate it.
Anyone?

Re: Save settings into a file
From:  pqbd
Date:  17. August 2012, 00:43

You can use the document.data or the item.data properties to save a piece of data natively in an illustrator file.

Re: Save settings into a file
Date:  19. August 2012, 13:14

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).

Re: Save settings into a file
From:  pqbd
Date:  22. August 2012, 22:45

I'm not sure about Windows, but on a mac it's stored in:
/Users/username/Library/Preferences/com.scriptographer.preferences.plist

The file is only read/written when Illustrator opens/closes, respectively.

Re: Save settings into a file
Date:  23. August 2012, 19:24

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.

Scripts
08.08.14, 15:24
15.05.14, 14:23
02.03.14, 19:16
18.11.13, 14:48
22.03.13, 03:05
22.02.13, 15:45
Posts
10.01.17, 16:37
19.02.16, 06:03
19.02.16, 06:00
17.01.16, 11:00
12.01.16, 13:10
25.11.15, 08:19
Script of the Moment
Ideé replacer 02.07.11
by peko