defaultFillColor Error thrown inconsistently.
I'm trying very simply to determine if the there is more than one color being used in some art, and if there is no error run a script. It appears that if I make 2 squares filled with black and white in a CMYK doc I get this error:
Eval Error (#1239): "Specified value greater than maximum allowed value"
If I add a Pantone color to that equation, I'll get [Gray Color] as a result. What I'm trying to do, is catch that error consistently since the defaultFillColor doesn't have a length. Can it be done?
The script I've been testing with is:
app.executeMenuCommand("selectall");
alert(app.activeDocument.defaultFillColor);