0 Replies Latest reply on Nov 5, 2014 4:51 AM by LearnIndesignScripting

    I want to add a progress bar

    LearnIndesignScripting Level 1

      Hi  

       

      I want to add a progress bar so that it will progress as this function process  I do not know how to set

       

      function myTag(elm)

                                                             {

                                                                

                                                                  var found = elm.xmlElements.length;

                                                                  var w = new Window ('palette');

                                                                  w.pbar = w.add ('progressbar', undefined, 0, found.length);

                                                                  w.pbar.preferredSize.width = 300;

                                                                  w.show();                                                       

                                                                

                                                                

                                                          try{

                                                              for (var i = 0; i < elm.xmlElements.length; i++)

                                                              {

                                                                  try{

                                                                      XMLelementName=elm.xmlElements[i].markupTag.name.toString();

                                                                      if(XMLelementName=="span")

                                                                      {

                                                                          if(elm.xmlElements[i].xmlAttributes.item("class").value == "elm-surname")

                                                                          {

                                                                             

                                                                              myName = elm.xmlElements[i].parent.contents.replace(elm.xmlElements[i].contents, "");

                                                                              myName = myName.replace(" ", "");

                                                                              var endIP = elm.xmlElements[i].insertionPoints.firstItem();

                                                                              var endTF = endIP.parentTextFrames[0];

                                                                              var endCitationPage = endTF.parentPage;

                                                                              myFinalName = elm.xmlElements[i].contents +"," + myName;

                                                                               WriteToFile(myFinalName+"  "+endCitationPage.name,reportFilePath);                                       

                                                                          }

                                                                          elm.xmlElements[0].select();

                                                                      }

                                                                  }catch(e){}

                                                                      w.pbar.value = i+1;

                                                                  $.sleep(20);

                                                                  myTag(elm.xmlElements[i]);

                                                             

                                                              }

                                                          }catch(e){}

                                                      }

       

       

       

       

      Help