Answered
adding guides to the first page
I'm trying to add guides to the first page but it's not working. Anyone know what I'm doing wrong here?
function createDocument(documentWidth, documentHeight, bleed) {
app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.PIXELS;
app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.PIXELS;
var doc = app.documents.add({
documentPreferences: {
pageWidth: documentWidth,
pageHeight: documentHeight,
documentBleedTopOffset: bleed,
documentBleedUniformSize: true,
facingPages: false
}
});
//Set the rulers to inches
app.activeDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.PIXELS;
app.activeDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.PIXELS;
// Add 2 pages to the document
for (var i = 0; i < 2; i++) {
doc.pages.add();
}
// Add guides to the first page
var page = doc.pages.item(0);
page.guides.add(HorizontalOrVertical.HORIZONTAL, 49);
page.guides.add(HorizontalOrVertical.HORIZONTAL, 751);
page.guides.add(HorizontalOrVertical.VERTICAL, 600);
page.guides.add(HorizontalOrVertical.VERTICALL, 648.75);
page.guides.add(HorizontalOrVertical.VERTICAL, 900);
}
if (checkbox1.value == true) {
createDocument(1200, 800, 9);
} else {
exit();
}
