I am trying to remove an unused tag from the document based on name.
I don't want to use app.activeDocument.deleteUnusedTags();
The code below removes the association between the item and the tag - but still leaves the tag in the tags panel:
var myDocument = app.activeDocument;
var xmlElements = myDocument.xmlElements;
for(var j=xmlElements.length-1; j>=0; j--){
for(var k=xmlElements[j].xmlElements.length-1; k>=0; k--){
var xmlTag = xmlElements[j].xmlElements.item(k).markupTag;
if(xmlTag.name == "Tag1"){
xmlElements[j].xmlElements[k].remove();
}
}
}
The code below deleted the tag and replaces it with Root - But I would like the pageitem to be untagged.
var myDocument = app.activeDocument;
var documentTags = myDocument.xmlTags;
for(var l=documentTags.length-1; l>=0; l--){
if(documentTags[l].name == "Tag1"){
var xmlTag = documentTags[l];
xmlTag.remove("Root");
}
}
Hopefully I am just missing something simple here...
Nathan Deamer
North America
Europe, Middle East and Africa
Asia Pacific