1 Reply Latest reply on Dec 14, 2010 7:41 AM by Marijan Tompa [tomaxxi]

    Creating Progress bar for simple script

    Techi Panda Level 2

      Hi scripters

       

      I have a small script to fit text frames  which is overflows text and remove pasteboard items. It works fine. Now I want to create a progress bar to this script. How can I?

       

      txtf=app.activeDocument.textFrames;

       

      for (a=0; a<txtf.length; a++)
      {
           var myDoc = app.activeDocument;
           var myTF = txtf[a];
           var myViewPr = myDoc.viewPreferences;
           var myHM = myViewPr.horizontalMeasurementUnits;
           var myVM = myViewPr.verticalMeasurementUnits;
           myViewPr.horizontalMeasurementUnits = MeasurementUnits.millimeters;
           myViewPr.verticalMeasurementUnits = MeasurementUnits.millimeters;
          app.selection=txtf[a];

       

           while (myTF.overflows)

                     {
                            var myBounds = myTF.geometricBounds;
                            myBounds[2] += 1;
                            myBounds[3] += 1;
                            myTF.geometricBounds = myBounds;
                    }

       

          txtf[a].fit(FitOptions.frameToContent);

      }

       

       

      myDoc = app.activeDocument;
      myObjs = myDoc.pageItems.everyItem().parent;
      for (j = myObjs.length - 1; j >= 0; j--)
          {
               if (myObjs[j].constructor.name == "Page")
                    { continue }
                 myDoc.pageItems[j].locked=false;
                myDoc.pageItems[j].remove();
        }

       

       

      Thanks in advane

       

      regards

      a r u l