Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

[JS][CS5] Application Labels

Participant ,
Aug 25, 2011 Aug 25, 2011

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    

TOPICS
Scripting
1.2K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Advisor , Aug 30, 2011 Aug 30, 2011

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

...
Translate
Community Expert ,
Aug 25, 2011 Aug 25, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 29, 2011 Aug 29, 2011

Do app labels persist after trashing prefs?

(I don't really use them much...)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Aug 29, 2011 Aug 29, 2011

Do app labels persist after trashing prefs?

No, they don't.

--

Marijan (tomaxxi)

http://tomaxxi.com

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 29, 2011 Aug 29, 2011

Thanks. That's what I would have guessed...

Harbs

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 29, 2011 Aug 29, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Aug 29, 2011 Aug 29, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Aug 30, 2011 Aug 30, 2011

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Aug 30, 2011 Aug 30, 2011
LATEST

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines