9 Replies Latest reply on Apr 20, 2018 7:09 AM by q3player

    Illustrator UI down while script is running.

    iLLMonkey Level 1

      Hi!

       

      I've made a script that helps me tremendously every day doing heavy repetitively work (moving around layers, grouping items etc.). There is one thing that's bugging me. While the script runs I can see whats happening on the screen, a layer moving here, moving there, making a group here and so on but after 2-3 seconds all of the illustrator UI turns black and then I can't see anything until the script is finished.

       

      This can be a problem because I want to know the progress of the task that the script is doing to determine if it's running at all or if it stopped/hanged etc.

       

      The only solution I have is to do a Window.alert("I'm alive"); once in a while but that requires me to always sit in front of the computer to press the "OK" button to dismiss the window.

       

      Any ideas?

        • 1. Re: Illustrator UI down while script is running.
          Tomas Sinkunas Level 3

          Is it regular ScriptUI script or a HTML panel?

          • 2. Re: Illustrator UI down while script is running.
            iLLMonkey Level 1

            The script has no UI, It's the illustrator UI that becomes inaccessible and you cant see what is happening the whole illustrator window says "not responding".

            • 3. Re: Illustrator UI down while script is running.
              Silly-V Adobe Community Professional

              I think that's an issue that happens to everyone, but to try and solve your problem, I want to explore an idea. What if, at some points you put in a checkIfAlive() function, and this function always attempts to retrieve a piece of stored data somewhere. Now, when it does not find this data, or find it set to false, the script proceeds. When it finds it set to true, it throws a confirm dialog which lets your illustrator hopefully refresh the screens, but also allows you to cancel or proceed. Could it be a solution to write text files as markers for when the script should pause? If writing the the file is done with a script or automation routine, the shortcuts to this routine can be triggered with a hot-key or clicked from a desktop dock.

              • 4. Re: Illustrator UI down while script is running.
                CarlosCanto Adobe Community Professional & MVP

                Add a progress bar, those keep updating even when the UI is not responsive.

                • 5. Re: Illustrator UI down while script is running.
                  iLLMonkey Level 1

                  Interesting take on the problem =), might try it, I'll let you know.

                  • 6. Re: Illustrator UI down while script is running.
                    iLLMonkey Level 1

                    This Progress bar thing makes sense, I'll try to hunt down script examples of how this might work, Meanwhile feel free to direct me. Thanks

                     

                    EDIT: think I found something progress bar to update as script runs . Seems like you solved that for him, I'll try it this week. man you are everywhere in this forum Carlos

                    • 7. Re: Illustrator UI down while script is running.
                      iLLMonkey Level 1

                      Hi!

                      Actually, for me, the progress bar also stopped responding as soon as illustrator did.

                       

                      I recorded a video to show:

                      bandicam 2017 09 13 21 55 19 112 - YouTube

                       

                      Sorry for blurring half of it, kinda secret.

                      • 8. Re: Illustrator UI down while script is running.
                        iLLMonkey Level 1

                        What ended up working was, as you suggested, writing to a text file. This is the only solution so far for me. I have points here and there in the script where i open a text file, write/append "I'm here in the script doing this or that", and then save it. So even if Illustrator is completely frozen I can with confidence know that it's working by looking at the textfile.

                        • 9. Re: Illustrator UI down while script is running.
                          q3player Level 3
                          function stwin () {
                              statuswin.add ('panel',[15, 15, 385, 220], "Aufgaben:");
                              statuswin.add ('statictext',[30, 30, 285, 100], "Ausgeblendete Ebenen löschen ...");
                              statuswin.add ('statictext',[30, 45, 285, 100], "Sammelordner ..._PRINT erstellen ...");
                              statuswin.add ('statictext',[30, 60, 285, 100], "Unterordner Bilder erstellen ...");
                              statuswin.add ('statictext',[30, 75, 285, 100], "Bilder sammeln ...");
                              statuswin.add ('statictext',[30, 90, 285, 100], "AI speichern ...");
                              statuswin.add ('statictext',[30, 105, 285, 100], "PDF/X-3 erstellen ...");
                              statuswin.add ('statictext',[30, 120, 285, 100], "Schriften in Pfade umwandeln ...");
                              statuswin.add ('statictext',[30, 135, 285, 100], "Ebene SF Weiss ausblenden ...");
                              statuswin.add ('statictext',[30, 150, 285, 100], "Ebene Lack ausblenden ...");
                              statuswin.add ('statictext',[30, 165, 285, 100], "Ansichts-PDF erstellen ...");
                              statuswin.add ('statictext',[30, 180, 285, 100], "AI mit Fonts in ZW speichern ...");
                              statuswin.add ('statictext',[30, 195, 285, 100], "Schriften sammeln ...");
                          
                              statuswin.pnl = statuswin.add("panel", [15, 215, 385, 300], "Druckdaten sind gesammelt zu ..."); 
                              statuswin.pnl.progBar = statuswin.pnl.add("progressbar", [20, 30, 340, 50], 0, 100); 
                              statuswin.pnl.progBarLabel = statuswin.pnl.add("statictext", [30, 33, 285, 235], "0%"); 
                          
                              statuswin.add ('statictext',[15, 310, 285, 400], scptver);
                              statuswin.show ();
                              }
                          
                          function stwin_delhidden() {
                          statuswin.add ('statictext',[305, 30, 345, 100], "erledigt");
                          statuswin.update();
                          statuswin.pnl.progBar.value= 10; 
                          statuswin.pnl.progBarLabel.text = statuswin.pnl.progBar.value+"%"; 
                          statuswin.update();
                          }
                          
                          function stwin_printfolder() {
                          statuswin.add ('statictext',[305, 45, 345, 100], "erledigt");
                          statuswin.update();
                          statuswin.pnl.progBar.value= 15; 
                          statuswin.pnl.progBarLabel.text = statuswin.pnl.progBar.value+"%"; 
                          statuswin.update();
                          }
                          
                          function stwin_imagefolder() {
                          statuswin.add ('statictext',[305, 60, 345, 100], "erledigt");
                          statuswin.update();
                          statuswin.pnl.progBar.value= 20; 
                          statuswin.pnl.progBarLabel.text = statuswin.pnl.progBar.value+"%"; 
                          statuswin.update();
                          }
                          
                          function stwin_images() {
                          statuswin.add ('statictext',[305, 75, 345, 100], "erledigt");
                          statuswin.update();
                          statuswin.pnl.progBar.value= 30; 
                          statuswin.pnl.progBarLabel.text = statuswin.pnl.progBar.value+"%"; 
                          statuswin.update();
                          }
                          
                          function stwin_cs6() {
                          statuswin.add ('statictext',[305, 90, 345, 100], "erledigt");
                          statuswin.update();
                          statuswin.pnl.progBar.value= 40; 
                          statuswin.pnl.progBarLabel.text = statuswin.pnl.progBar.value+"%"; 
                          statuswin.update();
                          }
                          
                          function stwin_x3() {
                          statuswin.add ('statictext',[305, 105, 345, 100], "erledigt");
                          statuswin.update();
                          statuswin.pnl.progBar.value= 50; 
                          statuswin.pnl.progBarLabel.text = statuswin.pnl.progBar.value+"%"; 
                          statuswin.update();
                          }
                          
                          function stwin_fontvect() {
                          statuswin.add ('statictext',[305, 120, 345, 100], "erledigt");
                          statuswin.update();
                          statuswin.pnl.progBar.value= 55; 
                          statuswin.pnl.progBarLabel.text = statuswin.pnl.progBar.value+"%"; 
                          statuswin.update();
                          }
                          
                          function stwin_sfweiss() {
                          statuswin.add ('statictext',[305, 135, 345, 100], "erledigt");
                          statuswin.update();
                          statuswin.pnl.progBar.value= 65; 
                          statuswin.pnl.progBarLabel.text = statuswin.pnl.progBar.value+"%"; 
                          statuswin.update();
                          }
                          
                          function stwin_lack() {
                          statuswin.add ('statictext',[305, 150, 345, 100], "erledigt");
                          statuswin.update();
                          statuswin.pnl.progBar.value= 70; 
                          statuswin.pnl.progBarLabel.text = statuswin.pnl.progBar.value+"%"; 
                          statuswin.update();
                          }
                          
                          function stwin_lowres() {
                          statuswin.add ('statictext',[305, 165, 345, 100], "erledigt");
                          statuswin.update();
                          statuswin.pnl.progBar.value= 80; 
                          statuswin.pnl.progBarLabel.text = statuswin.pnl.progBar.value+"%"; 
                          statuswin.update();
                          }
                          
                          function stwin_cs6zw () {
                          statuswin.add ('statictext',[305, 180, 345, 100], "erledigt");
                          statuswin.update();
                          statuswin.pnl.progBar.value= 90; 
                          statuswin.pnl.progBarLabel.text = statuswin.pnl.progBar.value+"%"; 
                          statuswin.update();
                          }
                          
                          function stwin_ende() {
                          statuswin.add ('statictext',[305, 195, 345, 100], "to do");
                          statuswin.update();
                          statuswin.pnl.progBar.value= 100; 
                          statuswin.pnl.progBarLabel.text = statuswin.pnl.progBar.value+"%"; 
                          statuswin.update();
                          $.sleep(2000);
                          }
                          
                          var statuswin = new Window ('palette', "Druckdaten werden gesammelt", [700, 200, 1100, 535], {independent:true});
                          
                          var scptver = "_MH_DDsammeln_komplett_v7a / März 2018";
                          
                          stwin ();
                          
                          stwin_delhidden ();
                          
                          stwin_printfolder ();
                          
                          stwin_imagefolder ();
                          
                          stwin_images ();
                          
                          stwin_cs6 ();
                          
                          stwin_x3 ();
                          
                          stwin_fontvect ();
                          
                          stwin_sfweiss ();
                          
                          stwin_lack ();
                          
                          stwin_lowres ();
                          
                          stwin_cs6zw ();
                          
                          stwin_ende ();
                          
                          // statuswin.close ();
                          
                          stwin_fontvect ();
                          
                          stwin_sfweiss ();
                          
                          stwin_lack ();
                          
                          stwin_lowres ();
                          
                          stwin_cs6zw ();
                          
                          stwin_ende ();
                          
                          // statuswin.close ();
                          
                          stwin_cs6zw ();
                          
                          stwin_ende ();
                          
                          // statuswin.close ();
                          

                           

                          I did a long and complex script by myself some time ago and it's in daily use on about 20 macs 5 days a week. I've extracted the parts with the floating window where the status is displayed and a status bar is implemented. Inside the script the actual AI file is saved, exported, closed, and re-opened 3 times, layers are set to visible and invisible, images are collected. Thanks to the status bar I didn't get any feedback about freezing screens. Maybe this might help.