Skip to content

Instantly share code, notes, and snippets.

@groupetma
Created May 11, 2015 10:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save groupetma/b825eb111e5f5dda7a23 to your computer and use it in GitHub Desktop.
Save groupetma/b825eb111e5f5dda7a23 to your computer and use it in GitHub Desktop.
Ce script affiche les mode de couleurs des liens (sauf EPS) This script display Links color space (except EPS files)
/* Ce script affiche les mode de couleurs des liens (sauf EPS)
This script display Links color space (except EPS files)
par ben@bencloutier.com
Pour révision des versions, voir au bas de ce document
*/
nomDuScript = "Affiche le modes couleur des liens"
dateRev = "1.0 (rev.19.11.2014)"
myId = "ben@bencloutier.com";
myDocument = app.activeDocument;
myLinks = myDocument.links;
myCMYKs = [];
myRGBs = [];
myErrors = [];
rgbLinks();
alert("Terminé:\n" + myCMYKs.length + " CMYK\n- " + myCMYKs.join("\n- ") + "\n\n" + myRGBs.length + " RGB\n- " + myRGBs.join("\n- ") + "\n\n" + myErrors.length+ " Erreurs\n- " + myErrors.join("\n- ") + "\n\n" + myId + "\n" + dateRev);
function rgbLinks(){
for (i=0;i<myLinks.length;i++){
myLink = myLinks[i];
try{
switch(myLink.parent.space){
case "CMYK":
myCMYKs.push(myLink.name + " (" + myLink.parent.space + ")" );
break;
case "CMJN":
myCMYKs.push(myLink.name + " (" + myLink.parent.space + ")" );
break;
case "RGB":
myRGBs.push(myLink.name + " (" + myLink.parent.space + ")" );
break;
case "RVB":
myRGBs.push(myLink.name + " (" + myLink.parent.space + ")" );
break;
default:
}
}catch(e){
myErrors.push(myLink.name + " (pas vérifiés)" );
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment