This content has been marked as final. Show 4 replies
Perhaps because you are untagging a selection (and thus everything inside it)? Apparently, the UI defaults to using the XML elements, not the text selection.
XMLElement has a function "untag", which states
>void untag ()
>Untags an element.
so you have to find the outer XML element somehow.
I found that with element(s) selected in the tree, this script works perfectly...
var myMenuAction = app.menuActions.item("$ID/Untag Element");
this not works in indesign cs2, i got an error as "app not has a property or method as .menuActions", how to handle this in indesign cs2?
--thanks in advance
Dear Subhaoviya,<br /><br /> Currently we can't get the "menuActions methods" in CS2. So we are able to indirectly use for what you expect.<br /><br />for your query :<br /> <contentA>1. <br /><contentB>Some content here.</contentB> <br /></contentA><br /><br />You need :<br /> <contentB>Some content here.</contentB> -> untag <br /><br />Your Answer :<br /> Some content here. <br /><br /> Like that? then here the below coding, you can use.<br /><br /> /** before you catch the XML Elements of the correct element **/<br /> var y = app.selection.characters.length;<br /> app.select(elm.xmlElements[i].characters, SelectionOptions.replaceWith);<br /> app.select(elm.xmlElements[i].characters[y-2], SelectionOptions.addTo);<br /> app.select(elm.xmlElements[i].texts); <br /> elm.xmlElements[i].untag(); <br /> <br /> // *now you get the untaged value of the currect Element.*//<br /><br />Please let me know if you have any queries.<br /><br />Thanks & Regards<br />T.R.Harihara SudhaN