2 Replies Latest reply on Jul 31, 2014 6:32 AM by T_Stevens

    Remove ALL xml

    T_Stevens Level 1

      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?