Adobe 27510753 Scripting Guide - Page 130
Using a preset, shown in the Creating a new document
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 130 highlights
122 Working with Documents in JavaScript Adobe InDesign CS2 Scripting Guide columnCount = 1; documentBleedBottom = "3p"; documentBleedTop = "3p"; documentBleedLeft = "3p"; documentBleedRight = "3p"; facingPages = true; pageOrientation = PageOrientation.portrait; pagesPerDocument = 1; slugBottomOffset = "18p"; slugTopOffset = "3p"; slugInsideOrLeftOffset = "3p"; slugRightOrOutsideOffset = "3p"; } Using a preset To create a new document using a document preset, use the document preset parameter as previously shown in the "Creating a new document" section. Setting up master spreads After you've set up the basic document page size, slug, and bleed, you'll probably want to define the document's master spreads: //MasterSpread.jsx //An InDesign CS2 JavaScript //Creates a document, then demonstrates setting master spread properties. //Set up the first master spread in a new document. myDocument = app.documents.add(); //Set up the document. with(myDocument.documentPreferences){ pageHeight = "11i" pageWidth = "8.5i" facingPages = true; pageOrientation = PageOrientation.portrait; } //Set the document's ruler origin to page origin. This is very important //--if you don't do this, getting objects to the correct position on the //page is much more difficult. myDocument.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin; with(myDocument.masterSpreads.item(0)){ //Set up the left page (verso). with(pages.item(0)){ with(marginPreferences){ columnCount = 3; columnGutter = "1p"; bottom = "6p" //"left" means inside; "right" means outside. left = "6p" right = "4p" top = "4p" } //Add a simple footer with a section number and page number. with(textFrames.add()){ geometricBounds = ["61p", "4p", "62p", "45p"]; insertionPoints.item(0).contents = SpecialCharacters.sectionMarker; insertionPoints.item(0).contents = SpecialCharacters.emSpace; insertionPoints.item(0).contents = SpecialCharacters.autoPageNumber; paragraphs.item(0).justification = Justification.leftAlign; } }