Quantcast
Channel: Adobe Community : Popular Discussions - InDesign Scripting
Viewing all articles
Browse latest Browse all 15932

Remove ALL xml

$
0
0

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:

Screen Shot 2014-07-30 at 10.14.43 AM.png

 

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:

Screen Shot 2014-07-30 at 10.24.36 AM.png

 

I need help untagging the text leftover in the 'Root' tag so that my final result is this:

Screen Shot 2014-07-30 at 10.25.46 AM.png

 

Any advice?


Viewing all articles
Browse latest Browse all 15932

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>