1 Reply Latest reply on Jun 3, 2009 5:06 PM by Thomas B. Nielsen

    Script for showing status

    sudar1983_14 Level 2

      Hi Guys,

       

      I need a script, that will show the status of the script

       

      for example,

       

      It is creating a paragraph styles then, Like vb label, it has to show,

       

      "Paragraphy style creating"

       

      something like this.

       

       

      regards,

      sudar.

        • 1. Re: Script for showing status
          Thomas B. Nielsen Level 3

          A JavaScript example:

           

          #targetengine "session"
          var myProgressPanel;
          var myMaximumValue = 100; // should be set to the amount of cycles (could be myDocument.pages.length, for a script looping all pages)

           

          var myProgressBarWidth = 300; // width in the window
          var myIncrement = myMaximumValue/myProgressBarWidth;
          myCreateProgressPanel(myMaximumValue, myProgressBarWidth);

           

          var myProgressPanel = myCreateProgressPanel(myMaximumValue, myProgressBarWidth);
          myProgressPanel.show();

           

          for (i = 0; i < myMaximumValue; i++) {
               myProgressPanel.myProgressBar.value = i;
               myProgressPanel.myStatus.text = "Cycle number: " + i ;
               for (n = 0; n < 10000; n++) {
                   myProgressPanel.mySecondaryStatus.text = "Sub cycle number: " + n;
               }
          }

           

          myProgressPanel.close();

           

          function myCreateProgressPanel(myMaximumValue, myProgressBarWidth){
               myProgressPanel = new Window('window', 'Progress');
               with(myProgressPanel){
                   myProgressPanel.myStatus = add('statictext', [12, 12, 300, 30], 'Working ...', {alignment: "left"});
                   myProgressPanel.mySecondaryStatus = add('statictext', [12, 12, 300, 30], 'Working ...', {alignment: "left"});
                   myProgressPanel.myProgressBar = add('progressbar', [12, 12, myProgressBarWidth, 24], 0, myMaximumValue);
               }
               return myProgressPanel;
          }

           

          Hope this helps you

           

          --

          Thomas B. Nielsen

          http://www.nobrainer.dk