Question
[Script] Problem with changing colors using selection and doc.defaultFillColor
Hi all, in one of the more recent updates to Illustrator, I have been unable to change a selection's fill color using, for example, the following:
var doc = app.activeDocument;
var sel = app.selection[0];
var grayCol = new RGBColor();
grayCol.red = 211;
grayCol.green = 211;
grayCol.blue = 211;
doc.selection = null;
var defColor = doc.defaultFillColor;
doc.defaultFillColor = grayCol;
There error I receive is a PARM error: "there is no document "
I have seen this behavior with a single simple page item selection, an app.executeMenuCommand(
"Find Fill Color menu item") or multiselection.
I have seen this across a few different scripts I've written. Think I saw it a couple months ago. Anyone else seen this and figured out a workaround, other than trying to change the selection's .fillColor property?

