0

我试过以下代码

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

我有一个错误

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

有没有办法取消标记根元素?

4

1 回答 1

0

我不认为你可以。即使您Structure通过 UI 打开窗格,您也无法删除或取消标记根元素 ( 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.

可以更改根元素的名称:

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
于 2013-06-26T14:50:45.760 回答