3 Replies Latest reply on Oct 29, 2012 11:49 PM by Harsh V Sharma

    progress bar to update as script runs

    dovidgold

      Hi, I'd like to have a progress bar being displayed as my script runs. I created a simple progress bar as follows:

       

      var win = new Window("palette", "SnpCreateProgressBar", [150, 150, 600, 260]); 
      win.pnl = win.add("panel", [10, 10, 440, 100], "Script Progress");
      win.pnl.progBar = win.pnl.add("progressbar", [20, 35, 410, 60], 0, 100);
      win.pnl.progBarLabel = win.pnl.add("statictext", [20, 20, 320, 35], "0%");
      
      win.show();
      
                          while(win.pnl.progBar.value < win.pnl.progBar.maxvalue)
                          {
                                    // this is what causes the progress bar increase its progress
                                    win.pnl.progBar.value++; 
                  win.pnl.progBarLabel.text = win.pnl.progBar.value+"%";
                                    $.sleep(10);
                          }
      
          alert('Done!'); 
      
      win.close();
      

       

      Now, if I target the ExtendScript Toolkit, I can see the "animation" of the bar progressing. But If I target illustrator, I only see when it's at 0% and then it jump to 100%. Is there a way to update the information visually as the script progresses?

       

      Thanks!

       

      I'm running CS6 on mac.