0

I have Tried Following Code

tell application "Adobe InDesign CS5.5"

select text of XML element 1 of active document

set xmlelem to item 1 of associated XML elements of selection

untag xmlelem

end tell

I got an error

"Adobe InDesign CS5.5 got an error: This element cannot be deleted."

Is there any way to untag root element?

robin
  • 25
  • 6

1 Answers1

0

I don't think you can. Even if you open up the Structure pane through the UI you can't delete or untag the root element (View -> Structure -> Show Structure).

tell application "Adobe InDesign CS5.5"
    set doc to active document
    untag XML element 1 of doc
end tell
-- Error: This element cannot be deleted.

You can change the name of the root element though:

tell application "Adobe InDesign CS5.5"
    set doc to active document
    set name of markup tag of XML element 1 of doc to "NewRoot"
end tell
Josh Voigts
  • 4,114
  • 1
  • 18
  • 43