Quantcast
Channel: Adobe Community : Popular Discussions - Illustrator Scripting
Viewing all articles
Browse latest Browse all 12845

Replace color via swatches

$
0
0

Hi,

 

I just need to find objects, texts or anything in page have spot color value of C=0 M=0 Y=0 K=100 into "Black" color.

The below is the tried coding, it is not finding  "Black" color in swatch list.


var doc = app.activeDocument;  
var item = doc.pageItems;  
var col = doc.swatches.getByName('Black');      
for(var i=0; i<item.length; i++){           if(item[i].fillColor.spot.color.cyan == 0 && item[i].fillColor.spot.color.magenta == 0 && item[i].fillColor.spot.color.yellow == 0 && item[i].fillColor.spot.color.black == 100){                  item[i].fillColor.spot.color == col;}     }



Not sure why it is not applying. It is doing fine if the color is in process mode.

 

if(item[i].fillColor.cyan == 0 && item[i].fillColor.magenta == 0 && item[i].fillColor.yellow == 0 && item[i].fillColor.black == 100){               item[i].fillColor == col;}  

 

Thanks,

Karthi


Viewing all articles
Browse latest Browse all 12845

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>