2 Replies Latest reply on May 30, 2010 11:19 PM by Tom Tomasko

    [JS CS3] How to show xml tag attributes

    Tom Tomasko Level 1

      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

        • 1. Re: [JS CS3] How to show xml tag attributes
          Shonkyin Level 3

          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

          • 2. Re: [JS CS3] How to show xml tag attributes
            Tom Tomasko Level 1

            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