0 Replies Latest reply on Feb 16, 2012 1:39 AM by V.Dnath

    INdesign Cs4 applescript

    V.Dnath Level 1

      hellow scripters

      i want to do untag all the 'emphasis' tags where they used .. i ran script as below but its delete all the content of all xml tags but i wnt to untag only "Emphasis" tag in xml structer..

      plz anybody help me...

      withregrds

      vbs007

       

       

       

      tell application "Adobe InDesign CS4"

          tell active document

              set theRoot to (item 1 of XML elements) -- the root element

              set theElements to every XML element of theRoot

              repeat with x in theElements

                  if (name of markup tag of x is not "aPNBox") and (name of markup tag of x is not "idline") and (name of markup tag of x is not "tagline") then tell x to untag

                  try

                      set x to every XML element

                      if (name of markup tag of x is equal to "emphasis") then set theSubElements to every XML element of x

                      repeat with y in theSubElements

                          if (name of markup tag of y is not equal to "emphasis") then untag x

                      end repeat

                  end try

              end repeat

          end tell

      end tell

      tell application "Adobe InDesign CS4"

          tell document 1

              delete unused tags

          end tell

      end tell