1 Reply Latest reply on May 13, 2013 5:33 AM by csm_phil

    How to apply paragraph styles to xml tag?

    Learner Learner Level 1

      Hi All,

       

      How to apply paragraph style to xml tag?

        • 1. Re: How to apply paragraph styles to xml tag?
          csm_phil Level 4

          Hi Learner,

           

          Try the below js code.

           

           

          var myDoc = app.activeDocument;
          try{
              mySel=app.selection[0];
              myDoc.xmlElements[0].xmlElements.add({markupTag:"TEST", xmlContent:mySel});
              }catch(e){
                  alert(e);
                  }
          
          
          
          var myDocument = app.activeDocument;
          app.findGrepPreferences.appliedParagraphStyle = "test";
          app.findGrepPreferences.findWhat = ".+(?=\\r)"
          var mySearch = myDocument.findGrep(false);
          for (a=0; a<mySearch.length; a++){
              myDocument.xmlElements[0].xmlElements.add({markupTag:"TEST", xmlContent:mySearch[a]});
              }
          

           

          thx,

          csm_phil