My company is changing processes away from an xml based workflow, so we have hundreds of InDesign files that need to have the xml removed. I'm writing a script that will do it automatically, but I'm having problems untagging all of the text. Most files have a structure like this:
My starting script here:
/*REMOVE TAGS*/
myDoc.xmlElements[0].xmlElements.everyItem().untag();
try{
myDoc.xmlInstructions[0].remove();
}
catch(e){};
myDoc.deleteUnusedTags();
var myRoot = myDoc.xmlTags[0].name;
$.writeln(myRoot);
myDoc.xmlTags.itemByName(myRoot).name = "Root";
/*END REMOVE TAGS*/
gives me this result:
I need help untagging the text leftover in the 'Root' tag so that my final result is this:
Any advice?