我尝试了下面的代码
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."有没有办法去掉root元素的标签?
发布于 2013-06-26 22:50:46
我觉得你做不到。即使通过UI打开Structure窗格,也不能删除或取消根元素(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 tellhttps://stackoverflow.com/questions/17320276
复制相似问题