I'm very new to javascript and I am writing a script to find all pathItems of a specified fill color and change them to another fill color. This must be done in RGB or hex without using swatches. So far I've put together bits of other scripts I found but I'm running into a lot of errors. Here is what I have so far:
var myDoc =app.activeDocument
var fillRGBColor = function (pathItem){
var fillColor = new Array();
fillColor[0] = myDoc.pathItem.fillColor.red;
fillColor[1] = myDoc.pathItem.fillColor.green;
fillColor[2] = myDoc.pathItem.fillColor.blue;
return fillColor;
}
fillRGBColor();
var pathItems = myDoc.pathItems;
for (i=0; i<pathItems.length; i++){
fillColor[255,255,255] ==fillColor[50,50,50];
}
Thank you!