6 Replies Latest reply on Jul 30, 2017 11:35 AM by Loic.Aigon

    Script request: Track Design Progress

    geiras Level 1

      Hey script magicians.

       

      I do a lot of editorial work, with documents that have plenty of pages. Those documents rely heavily on content generated by other people in the office like Excell spreadsheets, design elements made by other designers and texts made by copywriters.

       

      The editorial process also involves a lot of revisions to make sure the texts are okay and the Excel spreadsheets too. That's the reason why I need a script/plugin/better way to track the documents overall design process.

       

      Currently, I add colour tags to the pages by right clicking on the pages on the Pages panel > Pages Attributes > Color Label.

       

      I use three colours:

      RED: Not designed/not ready for review

      YELLOW: Under Review

      GREEN: Reviewed and Finished

       

      So, after a quick scroll through all the pages on the Pages panel, I can get a quick glimpse how the overall design process is and how many pages I have left to design and send to review.

       

      So, I was thinking that maybe there's a way to play a script and it would make a summary of the design process. The script would read the colour label of each page and present the results, like this:

       

      RED:  34 pages (34%)

      YELLOW: 10 pages (10%)

      GREEN:  56 pages (56%)

       

      So, would be much easier to know how much pages are within each state. I don't know if there are any plugins that do this or even if there's a better way to track the completion of the design process. So, if you know a better way, please tell me. If you know how to do a script that would do this, please tell me also.

       

      If there's someone on InDesign team that you can reach with a suggestion for a feature like this, please do so as well.

       

      Sorry if this was already posted but I couldn't find any topic on this. Maybe I'm using the wrong search terms.

       

      Thanks in advance,

      Geiras

        • 1. Re: Script request: Track Design Progress
          Loic.Aigon Adobe Community Professional
          var main = function() {
          var doc = app.properties.activeDocument,
          pgs, pg, db = {RED:0,YELLOW:0,GREEN:0,UNASSIGNED:0}, n, pageColor, pageCount;
          
          if ( !doc ) return;
          
          
          pgs = doc.pages.everyItem().getElements();
          
          
          pageCount = pgs.length;
          n = pageCount;
          
          while ( n-- ) {
          pg = pgs[n];
          pageColor = pg.pageColor.toString();
          if ( /(RED|YELLOW|GREEN)/.test( pageColor ) ) {
          db[pageColor]++;
          }
          else {
          db["UNASSIGNED"]++;
          }
          }
          
          
          for ( prop in db ){
          db[prop] = (db[prop]/pageCount*100)+"%";
          }
          
          alert("So you have…\r"+db.RED+" of RED pages\r"+db.GREEN+" of GREEN pages\r"+db.YELLOW+" of YELLOW pages\r"+db.UNASSIGNED+" of UNASSIGNED pages");
          }
          
          
          var u;
          
          
          app.doScript ( "main()",u,u,UndoModes.ENTIRE_SCRIPT, "The Script" );
          

           

          Capture d’écran 2017-07-25 à 23.16.06.png

           

          HTH

           

          Loic

          1 person found this helpful
          • 2. Re: Script request: Track Design Progress
            geiras Level 1

            Hey Loic.

             

            I first asked IndesignSecrets if they knew about a script that could do this and they told me to post on Adobe Forums because they knew someone like you would reply. This morning I got a new tweet that said:

             

            "Cool! Does it do the job for you? So glad @loicaigon came to the rescue, he’s amazing. Neat script, we’ll check it out!"

             

            Thank you for the script. I marked the answer as correct although I made some changes. (It was my first time editing a script).

            I rounded the result of the math operation because in Windows it was appearing with a lot of decimals. I also changed the text so it is more clear to me.

             

            Once again, thank you! This really helped me.
            Peace!

             

             

             

            var main = function() {  
            var doc = app.properties.activeDocument,  
            pgs, pg, db = {RED:0,YELLOW:0,GREEN:0,UNASSIGNED:0}, n, pageColor, pageCount;  
              
            if ( !doc ) return;  
              
              
            pgs = doc.pages.everyItem().getElements();  
              
              
            pageCount = pgs.length;  
            n = pageCount;  
              
            while ( n-- ) {  
            pg = pgs[n];  
            pageColor = pg.pageColor.toString();  
            if ( /(RED|YELLOW|GREEN)/.test( pageColor ) ) {  
            db[pageColor]++;  
            }  
            else {  
            db["UNASSIGNED"]++;  
            }  
            }  
              
              
            for ( prop in db ){  
            db[prop] = (Math.round(db[prop]/pageCount*100))+"%";
            }  
              
            alert("RED: "+db.RED+"\r\rGREEN: "+db.GREEN+"\r\rYELLOW: "+db.YELLOW+"\r\r");  
            }  
              
              
            var u;  
              
              
            app.doScript ( "main()",u,u,UndoModes.ENTIRE_SCRIPT, "The Script" );  
            
            • 3. Re: Script request: Track Design Progress
              Loic.Aigon Adobe Community Professional

              And it can be so much fun:

              Capture d’écran 2017-07-26 à 13.52.43.png

              • 4. Re: Script request: Track Design Progress
                geiras Level 1

                Damn! I guess I don't know how powerful these scripts are. This is really nice!
                I guess I'll have to send a friend request to JavaScript! Ahahahah.


                Loic, do you keep a page where you post all the scripts you write? Maybe I can find more interesting things there!
                Thanks again for the help.

                • 5. Re: Script request: Track Design Progress
                  geiras Level 1

                  Loic, could you post the code to that script? I have a shortcut that runs the other script, but that one is much easier to read. If you can, would be much appreciated...

                  • 6. Re: Script request: Track Design Progress
                    Loic.Aigon Adobe Community Professional

                    Hi geiras,

                     

                    Thanks for the comments. I have a website with some goodies and a blog where I present some ideas and projects. Unfortunately both aren't as vivid as I wish they are : www.ozalto.com

                     

                    For the current topic, the pie isn't actually extendscript but a HTML/JS extension. I used D3.js for the pie. Although nothing is terrifically complex here, there are a few intricacies that would take too long to explain here.

                    But the idea is basically to retrieve status values per pageColor property and pass those to D3.js for visual representation.

                     

                    If this is something that interests you, i advise you to go at

                    Adobe CEP · GitHub

                     

                    Loic