Reply To: Script to search for an XML tag and remove it

#94368
Masood Ahmad
Participant

Hi Loic,

There is an error in the script, can you please check and fix the error. I’m trying this on InDesign CS5


<pre class="brush: javascript">
var main = function() {
var doc = app.properties.activeDocument, root, xes, n;
if ( !doc ) return;
root = doc.xmlElements[0];
xes = root.evaluateXPathExpression ( ".//SalaryDescription" );
n = xes.length;
while ( n– ) xes[n].remove();
}

var u;

app.doScript ( "main()",u,u,UndoModes.ENTIRE_SCRIPT, "The Script" );

This article was last modified on May 9, 2017

Comments (0)

Loading comments...