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 wi
Indeed you have a lot of erros in your script. Looking at the type of errors I suggest you to read Adobe Illustrator CS5 Reference: JavaScript or any JavaScript tutorial.
In any case you can reduce your JavaScript errors by my modified version of your code.
var fillRGBColor = function (pathItems, r, g, b){
for (var i=0; i < pathItems.length; i++) {
pathItems[i].fillColor.red = r;
pathItems[i].fillColor.green = g;
pathItems[i].fillColor.blue = b;
}
}
fillRGBColor(app.activeDocument.pathItems, 50, 50, 50);