"Error: Invalid value for set property 'fillColor'. Expected Swatch, String or NothingEnum enumerator, but received in indesign"
Am facing this error, try to find object fill color.
varmyColors = myDoc.colors;
var_counter = 0;
for(varl=0;l<myColors.length;l++){
if(myColors[l].name.search("DO NOT PRINT","i") >-1 || myColors[l].name.search("DO_NOT_PRINT","i") >-1 || myColors[l].name.search("DONOTPRINT","i") >-1 ){
_counter++;
if (_counter == 1) {
_DO_NOT_PRINT_Swatches.push(myColors[l].name);
_DO_NOT_PRINT_Swatches1.push(myColors[l].name);
}
else{
_DO_NOT_PRINT_Swatches.push("\t\t\t" +myColors[l].name);
_DO_NOT_PRINT_Swatches1.push(myColors[l].name);
}
}
}
for(vars=0;s<_DO_NOT_PRINT_Swatches1.length;s++){
app.findChangeObjectOptions.objectType = ObjectTypes.ALL_FRAMES_TYPE;
app.findObjectPreferences.fillColor = _DO_NOT_PRINT_Swatches1[s];
varresultObject = myDoc.findObject();
if(resultObject.length>0){
var_counter = 0;
for(varobj=0;obj<resultObject.length;obj++){
_counter++;
if(_counter == 1){
_Do_Not_Print_Object_Array.push("page "+resultObject[obj].parentPage.name+"-->"+_DO_NOT_PRINT_Swatches1[s]);
}
else{
_Do_Not_Print_Object_Array.push("\t\t\tpage "+resultObject[obj].parentPage.name+"-->"+_DO_NOT_PRINT_Swatches1[s]);
}
}
}
}