scripting issue centering text and bleed
I almost have this working but I can't seem to figure out 2 things.
1. Not a deal breaker because it still kind of works, but when I create the document it is not setting the bleed. The black rectangle still extends to bleed but the its not setting in the document setup/bleed.
2. I can't seem to get the text to center, I get "Error Number: 2 Error String: justification is undefined" and I don't understand why. Any help would be greatly appriciated!
// Create a new document with a width of 6 inches, a height of 9 inches, and a bleed of .125 inches
var doc = app.documents.add({
documentPreferences: {
pageWidth: 6,
pageHeight: 9,
bleedTop: .125,
bleedLeft: .125,
bleedBottom: .125,
bleedRight: .125
}
});
// Create a black rectangle that extends to the full bleed
var rect = doc.rectangles.add({
geometricBounds: [-.125, -.125, 9.125, 6.125]
});
rect.fillColor = "Black";
// Create a text frame with the text
var textFrame = doc.textFrames.add();
textFrame.properties =
{
geometricBounds: [2.96,0.25,4.3,5.75],
contents: "Text Here\nand More Here"
};
// Format text
var textRange = textFrame.characters.everyItem();
textRange.appliedFont = "Helvetica Neue LT Std\t77 Bold Condensed";
textRange.pointSize = 51;
textRange.leading = 55;
textRange.fillColor = "Paper";
textRange.justification = justification.CENTER;