Copy link to clipboard
Copied
I initially put this in the InDesign forum.......
Now I am in the right place, here goes again.
Hi
Over time I have been using the Application Label feature to store simple script preferences. Is there somer way I can get a collated list of these so I can delete some, or at least audit what I have done!
Cheers
Roy
Hi Roy,
It's definitely better to save settings to file.
You can create simple JSON text file from your settings object (myObject.toSource()),
and just use eval() to convert it back to Object.
Another, more safer way is to create XML file
and use E4X to find specific settings you need to load.
I think that saving file into InDesign application folder is not a good idea.
On some systems, especially Windows Vista and Windows 7,
saving to Application folder is disabled if the UAC (User Account Control) is
...Copy link to clipboard
Copied
Hi, Roy!
Do the application labels persist after doing a dot update?
About your question: I don't know a way to trace the labels, which does not imply there is no way to do so.
Regarding labels on document level you can trace, modify, add or delete them in an IDML file.
Uwe
Copy link to clipboard
Copied
Do app labels persist after trashing prefs?
(I don't really use them much...)
Copy link to clipboard
Copied
Do app labels persist after trashing prefs?
No, they don't.
--
Marijan (tomaxxi)
http://tomaxxi.com
Copy link to clipboard
Copied
Thanks. That's what I would have guessed...
Harbs
Copy link to clipboard
Copied
Hi Harbs/Marijan
Would you recommend using a config file in the scripts folder instead of using Application labels?
I did find a way to open a file in the InDesign Application folder that contained the labels, but was not easy to read, and certainly wouldn't make any changes to it as it also contained garbled text that I am assuming would cause problems if I resaved as a text file.
Cheers
Roy
Copy link to clipboard
Copied
Yes. I would definitely recommend writing to a config file instead. It's not really much harder, and it leaves you in the drivers seat... ![]()
Harbs
Copy link to clipboard
Copied
Hi Roy,
It's definitely better to save settings to file.
You can create simple JSON text file from your settings object (myObject.toSource()),
and just use eval() to convert it back to Object.
Another, more safer way is to create XML file
and use E4X to find specific settings you need to load.
I think that saving file into InDesign application folder is not a good idea.
On some systems, especially Windows Vista and Windows 7,
saving to Application folder is disabled if the UAC (User Account Control) is enabled.
You could save user settings to native user data folder.
var setFolder = Folder(Folder.userData.absoluteURI + "/RoyMarshall");
if(!setFolder.exists) setFolder.create(); var setFile = File(parentFolder.absoluteURI + "/myScriptSettings.xml");
Hope that helps.
--
Marijan (tomaxxi)
http://tomaxxi.com
Copy link to clipboard
Copied
Thanks guys.
That seems like a pretty safe method using the xml in the users folder. Works nicely.
Just a small thing though..
var setFile = File(parentFolder.absoluteURI + "/myScriptSettings.xml");
parentFolder needs to be setFolder, but I know this was quickly put together for my instructions so no matter!!
Cheers again
Roy
Find more inspiration, events, and resources on the new Adobe Community
Explore Now