1 Reply Latest reply on Jun 11, 2009 2:01 PM by Randomsen

    XML Comment in Indesign using Apple script.

      Hi all,

      How to find the selected XML element is commented in indesign and get XML comment value in thru apple script. Any Ideas?

      -Jacintha
        • 1. Re: XML Comment in Indesign using Apple script.
          Randomsen Level 1

          You can have as many comments as you want so they require you to state the index of the comment in your reference.

          Assuming you have an object reference for the XML element, you would replace "associated XML element of selection" with that.

           


          tell application "Adobe InDesign CS3"   
              set myComments to {}
              if every XML comment of associated XML element of selection is not {} then
                  set end of myComments to value of every XML comment of associated XML element of selection
              end if
              return myComments
          end tell

           

          if you know there's only going to be one comment then,

           

           

          tell application "Adobe InDesign CS3"

           

              if every XML comment of associated XML element of selection is not {} then
                  set  myComment to value of XML comment 1 of associated XML element of selection
              end if
              return myComment
          end tell

           

          ~Mike