• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Script request: Track Design Progress

Explorer ,
Jul 25, 2017 Jul 25, 2017

Copy link to clipboard

Copied

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

TOPICS
Scripting

Views

839

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

People's Champ , Jul 25, 2017 Jul 25, 2017

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;

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.

...

Votes

Translate

Translate
People's Champ ,
Jul 25, 2017 Jul 25, 2017

Copy link to clipboard

Copied

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;

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 26, 2017 Jul 26, 2017

Copy link to clipboard

Copied

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 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

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" ); 

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jul 26, 2017 Jul 26, 2017

Copy link to clipboard

Copied

And it can be so much fun:

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 26, 2017 Jul 26, 2017

Copy link to clipboard

Copied

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.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Jul 28, 2017 Jul 28, 2017

Copy link to clipboard

Copied

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...

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
People's Champ ,
Jul 30, 2017 Jul 30, 2017

Copy link to clipboard

Copied

LATEST

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

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines