3 Replies Latest reply on Oct 11, 2010 7:31 AM by Pontus Uggla

    Progress bar in CS5

    Pontus Uggla Level 1

      I have an progress bar object that stoped working in CS5, it worked well in CS4.


      If I alert the string (str) in set_info it updates the palette, it updates fine. So it seems that i have to update the window some how.


      this.progress.layout.layout(true); did not work.


      var Progress = {

        progress: null,


        show_panel: function() {

          this.progress = new Window(

            "palette { \

              progressInfo: StaticText { text: '', size: [400, 16] }, \

              subInfo: StaticText { text: '', size: [400, 16] }, \

              mainProgressBar: Progressbar { size: [400, 10] }, \

              subProgressBar: Progressbar { size: [400, 10] } \

            }", "Progress"



          this.progress.progressInfo.text = "Startar import...";






        set_info: function(str) {

          this.progress.progressInfo.text = str;

          this.progress.subInfo.text = '';


        • 1. Re: Progress bar in CS5
          Marijan Tompa [tomaxxi] Level 4



          Maybe you can use Marc Autrets progress bar function!

          It's perfect!









          • 2. Re: Progress bar in CS5
            Pontus Uggla Level 1

            Well i tried mine separatly and it worked fine as well, i just put $.sleep(1000); in between updates.


            To me it seems like its not updating the window because it is too busy generating the document, since it worked fine when i paused it with an alert..?

            • 3. Re: Progress bar in CS5
              Pontus Uggla Level 1

              I just found some time to do some serious testing. It had to be set of by a menu item to trigger it.


              So what this is is a menu item with a script menu action.


              Not that I start by removing all existing script menu actions, if you like to test my code.


              It triggers a function that makes a dialog and the word Start sets, it centers and is shown.


              Right after this I try changing the text to Test, then sleep for 3 seconds and then an alert.


              I would expect the text to be Test so fast that you wint see the 'Start' text at all, but it wont show until the alert.


              In my big script I open documents, add pages etc, but the progress bar doesn´t update until its all finished.


              I think this is a bug, or i´m missing something..?


              I tried the exact same script in CS4 and it worked, so it seems to be a new thing.


              #targetengine 'session' test_menu = app.menus.item('$ID/Main').submenus.add('Test'); app.scriptMenuActions.everyItem().remove(); app.menus.item('$ID/Main').submenus.item('Test').submenus.everyItem().remove(); var test_sub_menu = app.scriptMenuActions.add('Test'); test_sub_menu.eventListeners.add('onInvoke', function() {      var win = new Window(           "palette { \                info_line: StaticText { text: '', size: [400, 16] }, \                bar: Progressbar { size: [400, 10] } \           }",           "Progress"      );      win.info_line.text = "Start";      win.center();      win.show();      win.info_line.text = "Test";      $.sleep(3000);            alert('Test');            win.close();      }); test_menu.menuItems.add(test_sub_menu);