0 Replies Latest reply on Jan 7, 2012 6:11 AM by snegig

    Edit JS Script CS4 (Add XML Tags All pages automatically)

    snegig

      Hi, all Scripter


      I have a javascript for add xml tags (ETMV2 Pearson, InDesign CS4).  We have select my powermath equation data then run script. Script automatically insert xml tags both side (open/close). But we select one by one then run script its time taking.

       

      var d=app.activeDocument,

      root=d.xmlElements[0],

      ie = root.xmlElements.add("inlineequation", app.selection[0]),

      im = root.xmlElements.add("inlinemediaobject", ie.texts[0]),

      to = root.xmlElements.add("textobject", im.texts[0]);

      to.xmlAttributes.add("role", "xpressmath");


       

      Example 1: My powermath equation data (InDesign CS4)

      [&x^{2}+y *frac*{1}{2x}&]

       

       

      Select powermath equation data then run javascript below mention. Script insert xml tags.

      <inlineequation><inlinemediaobject><textobject>[&x^{2}+y *frac*{1}{2x}&]</inlineequation></inlinemediaobject></textobject>

      Its time taking and select one by one

       

       

      Result:

      My main concern is that is this possible script find open [& and close &] all poermath equation data automatically then insert (add) xml tags all pages.

       

      Thank/Regard

      snegig