I replaced the text formatting section with 2 arrays and a loop, and I think it's more along the lines of what you're trying to do? If not, I haven't really worked with ranges in InDesign so this was good practice! Screen Grab of result below: Script below replaces original lines 132-155: sw = app.activeDocument.swatches;
// Set the text content
graphicSpecs.contents = productName + " Graphic Template\r";
// Set the text color to black
col = ["Black","C=100 M=0 Y=0 K=0","Black","C=75 M=5 Y=100 K=0","C=15 M=100 Y=100 K=0","Black"]
theText = ["Document Size: " + pageWidthIN + "\" x " + pageHeightIN + "\"\r",
"Finished Size: " + finishedWidthIN + "\" x " + finishedHeightIN + "\"\r",
"Safe Size: " + safeWidthIN + "\" x " + safeHeightIN + "\"\r",
"Bleed: " + bleedIN + "\" on each of 4 sides\r",
"100 DPI\rAll text should be converted to outlines"
]
for(var i = 0; i<theText.length; i++){
var curText = theText[i];
var start = graphicSpecs.contents.length;
var end = start+curText.length-1;
graphicSpecs.contents +=curText;
graphicSpecs.characters.itemByRange(start,end).fillColor = sw.item(col[i]);
}
... View more