how can I change the CMYK color of all selected same fill Colors?
I am trying to select all of the same fill CMYK color and then change the color to a different fill color with CMYK. I know I can do so using the Select>Same>Fill Color, but I am trying to add it into a larger script. I feel like I am close but when I run this it is only selecting the same fill color, shows the spinning color wheel for a second or two and then leaves the colors the same. I am fairly new to Javascript so I am not sure what I am doing wrong. is anyone able to help?
//the stockColors are part of the whole script. I am just using the one color for testing purposes.
stockColors = {
BlackPoly : [80, 72, 68, 100],
LightBlue : [100, 43, 0, 30],
DarkBluePoly: [95, 74, 7, 44],
PurplePoly : [82, 98, 0, 12],
GreenPoly : [90, 12, 95, 40],
YellowPoly : [0, 19, 89, 0],
EcruPoly : [6, 13, 41, 4],
OrangePoly : [0, 73, 98, 0],
RedPoly : [7, 100, 82, 26],
GreyPoly : [10, 4, 4, 14],
WhitePoly : [0, 0, 0, 0]
};
newCMYKColor.cyan = stockColors[0];
newCMYKColor.magenta = stockColors[1];
newCMYKColor.yellow = stockColors[2];
newCMYKColor.black = stockColors[3];
var doc = app.activeDocument;
if(doc.length < 0){
newColor=stockColors[105,0,0,10];
var swatch =doc.selection["CMYK",0,0,0,10];
app.executeMenuCommand('Find Fill Color menu item');
temp = app.selection;
temp.fillColor=newColor;
}else{
alert('nope nope.')}
