JavaScript Share - Create 373 Cyan tints for printing and choosing colors from the printer you use.
This code will generate Cyan tints labled on a page with an 1/8" bleed for commercial printing applications.
var i = 0;
var ii = 0;
var y = 0;
var x = 0;
var ccount = 0;
var aDoc = app.documents.add();
for (; i < 374; ) {
if (x == 0 && y == 0) {
var Rect = aDoc.pathItems.rectangle(y - 9, x - 9, 36 + 9, -36 - 9)
} else {
if (y == 0 && x > 1 && i < 16) {
var Rect = aDoc.pathItems.rectangle(y - 9, x, 36, -36 - 9)
} else {
if (y == 0 && x == 576) {
var Rect = aDoc.pathItems.rectangle(y - 9, x, 36 + 9, -36 - 9)
} else {
if (x == 0 && i < 342) {
var Rect = aDoc.pathItems.rectangle(y, x -9 , 36 + 9, -36)
} else {
if (i == 357) {
var Rect = aDoc.pathItems.rectangle(y, x - 9, 36 + 9, -36 - 9)
} else {
if (i > 357 && i < 373) {
var Rect = aDoc.pathItems.rectangle(y, x, 36, -36 - 9)
} else {
if (i == 373) {
var Rect = aDoc.pathItems.rectangle(y, x, 36 + 9, -36 - 9)
} else {
if (x > 540 && y > 0 && y < 756) {
var Rect = aDoc.pathItems.rectangle(y, x, 36 + 9, -36)
} else {
var Rect = aDoc.pathItems.rectangle(y, x, 36, -36)
}
}
}
}
}
}
}
}
Rect.stroked = false;
Rect.filled = true;
var itemColor = new CMYKColor();
itemColor.cyan = ccount;
itemColor.magenta = 0;
itemColor.yellow = 0;
itemColor.black = 0;
var ccount = ccount + .1;
Rect.fillColor = itemColor;
//text
var textFrame = app.activeDocument.textFrames.add();
textFrame.contents = itemColor.cyan.toFixed(1);
textFrame.font = "JasmineUPC";
textFrame.size = 12;
var xp = x + 9;
var yp = y + 18;
textFrame.position = [xp, yp];
//textFrame.characterAttributes.color = [0, 0, 0];
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;
}
}
