ID find rgb on bitmaps change to swatch black
var d = app.activeDocument;
var pgs = d.pages;
for (var i = 0; i < pgs.length; i++){
var rects = pgs[i].rectangles;
for (var j = 0; j < rects.length; j++){
if(rects[j].images.length >0){
img = rects[j].images[0];
var colVal = img.fillColor.colorValue;
if(colVal.length <= 3){
img.fillColor = d.swatches.item(3);
alert("changed rgb to swatch black");
}
}
}
}