Scripting Cycle Through Cyan Shades
Why does my scipt crash when I delete the two occurances of /**/ (leaving in the code) and deleting the single line of code with the // trailing the cyan variable?
var i = 0;
var ii = 0;
var y = 0;
var x = 0;
var aDoc = app.documents.add();
for (; i < 374; ) {
var Rect = aDoc.pathItems.rectangle(y, x, 36, -36);
Rect.stroked = false;
Rect.filled = true;
var itemColor = new CMYKColor();
/*if (i = 0) {
itemColor.cyan = 0;
}*/
itemColor.cyan = 97; //Why deleting this line and uncommenting code doesn't work???
itemColor.magenta = 0;
itemColor.yellow = 0;
itemColor.black = 0;
Rect.fillColor = itemColor;
/*if (x > 0 && x < 594 && itemColor.cyan < 100) {
itemColor.cyan = itemColor.cyan + 1;
}*/
var ii = ii + 1;
var i = i + 1;
var x = x + 36;
if (ii == 17) {
var ii = 0;
var x = 0;
var y = y + 36;
}
}You can run the script as is and it doesn't crash and makes nice even 1/2" squares on 8.5x11 however when I try to impliment the part of code to change through 0 - 100 shades of cyan something breaks. Maybe I'm not getting to the var in the for loop from the if statements?
