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

[JS CS3] How to show xml tag attributes

Explorer ,
May 30, 2010 May 30, 2010

Hello,

I have a series of xml tags, all of which have attributes. Sometimes I want to see the attributes along with the tags in the structure bay, but sometimes I do not.

The following always hides the attributes:

var myDoc = app.activeDocument;
myDoc.xmlViewPreferences.showStructure = true;
myDoc.xmlViewPreferences.showAttributes = false;

However, the following does not show the attributes unless I have already manually revealed them myself and then hid them (either manually or via script). How can make the attributes show?

var myDoc = app.activeDocument;
myDoc.xmlViewPreferences.showStructure = true;
myDoc.xmlViewPreferences.showAttributes = true;

Thanks,

Tom

TOPICS
Scripting
412
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
Engaged ,
May 30, 2010 May 30, 2010

Your code is working on my system with Indesign CS3 5.0.4.

Make sure you have updated your Indesign CS3 with latest one.

Shonky

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
Explorer ,
May 30, 2010 May 30, 2010
LATEST

I have the same version of CS3.

I have further—and strange—information.

In the structure pane there is a menu where there is an option to either show or hide the attributes. If I click on these I can close up the xml elements to hide the attributes or expand the elements to show the attributes, but the only ones that will expand are those that I have previously expanded by clicking on the little triangle next to the xml tag. So this works just like the script.

However, if I hold down the command key (on a Mac) and then click the parent tag (most cases this is the Story tag), then I can open up or close up all of the  child xml elements.

After I used the Command key-click-on-triangle trick, then the scripts to open or close the xml tags works just like I want them to.

Hmmm...so is there a way to script using the command key without actually using it?

Tom

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