1 Reply Latest reply on Dec 9, 2014 3:21 AM by ana_barros

    Map tags to styles (CS6, Applescript)

    Peter Bossens

      I want to map a series of tags to styles in InDesign, but this seems not to work.

      The inverse, mapping styles to tags, works!

       

      Any idea? Thanks for your help!

       

      tell application "Adobe InDesign CS6"

                tell active document

        make XML export map with properties {markup tag:"Header", mapped style:"Header"}

        map XML tags to styles

                end tell

      end tell

        • 1. Re: Map tags to styles (CS6, Applescript)
          ana_barros

          Hello, try

           

          tell application "Adobe InDesign CS6"

              set myDocument to active document

              tell myDocument

                  set tList to name of every XML tag

                  set tNumItems to count of tList

                

                  -- XML tag to style mapping by name.

                  repeat with j from 1 to tNumItems

                      set tStyle to item j of tList

                      make XML import map with properties {markup tag:tStyle, mapped style:tStyle}

                  end repeat

                  --Map tags to styles.

                  map XML tags to styles

                  --Map styles to XML tags by name

                  repeat with j from 1 to tNumItems

                      set tStyle to item j of tList

                      make XML export map with properties {markup tag:tStyle, mapped style:tStyle}

                  end repeat

                

                  --Map styles to tags.

                  map styles to XML tags

              end tell

              --Export xml para desktop para pasta a designar

              tell active document

                  export to "xxxxxxxxx:aaaaaaaaa.xml" format "XML"

              end tell

          end tell