How to define my color?
Hi experts,
I have a script:
app.findObjectPreferences = null;
app.findObjectPreferences.fillColor = "MARKUP";
app.changeObjectPreferences.fillColor = "Black";
app.changeObject();
app.findObjectPreferences = null;
app.findObjectPreferences.strokeColor = "MARKUP";
app.changeObjectPreferences.strokeColor = "Black";
app.changeObject();
for find and change object color, but if the docs which has no such as color name in the swatch, the script will run into error, so, how can I define if no such as color, script continue? how can make the script as below working?
var myDoc = app.activeDocument;
myColor = myDoc.colors.name("MARKUP");
if (!cmyColor) continue;
app.findObjectPreferences = null;
app.findObjectPreferences.fillColor = myColor;
app.changeObjectPreferences.fillColor = "Black;
app.changeObject();
app.findObjectPreferences = null;
app.findObjectPreferences.strokeColor = myColor;
app.changeObjectPreferences.strokeColor = "Black";
app.changeObject();
thanks
Regard
John
