0 Replies Latest reply on May 16, 2016 5:37 AM by hamdifem

    progsess bar show array

    hamdifem Level 1

      progress bar while working

      elements in an array

      I can show you how to order

       

      function find() {
      var myDoc = app.activeDocument;
      app.findGrepPreferences = app.changeGrepPreferences = null;       
      app.findGrepPreferences.appliedCharacterStyle = "myPar4";
      
      
      var myArray = [];
      var myFinds = myDoc.findGrep();
      
      
      for(var i =0;i<myFinds.length;i++)  {        
              myArray.splice(0,1)
              myArray.push(myFinds[i].contents);            
          }
      
      
      app.findGrepPreferences = app.changeGrepPreferences = null;
      
      
      return myArray;
      }
      
      
      function pb() {
          var myPrs = new Window('palette', 'Batch Processing');
          myPrs.orientation = 'column';
          myPrs.alignment = 'right';
          myPrs.ProcessHead  = myPrs.add('statictext',[40,0,260,25], "Çalışıyor...");
          myPrs.Process = myPrs.add("progressbar",[40,40,260,65]);
          myPrs.Label = myPrs.add('statictext', [150,75,200,120], "0%");
          myPrs.Label2 = myPrs.add('statictext', [150,75,200,120], "");
          myPrs.Process.value = 0;    
          myPrs.show();
      
      
          return function(v, LENGTH) {
              var islem = find();
               var value = (Number(v) / LENGTH) * 100;
                  total.push(bul());
               myPrs.Label.text = Math.round(value) + " % ";
               myPrs.Label2.text = islem;         
               myPrs.Process.value = value;
          };
      }
      /****************
      case 24;
      var pbar = pb();
      pbar(1, total.length + 1);
      */