Adobe 27510753 Scripting Guide - Page 164
To apply a master spread to a document use the, property of the document AppliedMaster
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 164 highlights
156 Working with Documents in VBScript Adobe InDesign CS2 Scripting Guide Rem Set up the first master spread in a new document. Set myDocument = myInDesign.Documents.Add Rem Set up the document. With myDocument.DocumentPreferences .PageHeight = "11i" .PageWidth = "8.5i" .FacingPages = True .PageOrientation = idPageOrientation.idPortrait End With Rem Set the document's ruler origin to page origin. This is very important Rem --if you don't do this, getting objects to the correct position on the Rem page is much more difficult. myDocument.ViewPreferences.RulerOrigin = idRulerOrigin.idPageOrigin With myDocument.MasterSpreads.Item(1) Rem Set up the left page (verso). With .Pages.Item(1) With .MarginPreferences .ColumnCount = 3 .ColumnGutter = "1p" .Bottom = "6p" Rem "left" means inside "right" means outside. .Left = "6p" .Right = "4p" .Top = "4p" End With Rem Add a simple footer with a section number and page number. With .TextFrames.Add .GeometricBounds = Array("61p", "4p", "62p", "45p") .InsertionPoints.Item(1).Contents = idSpecialCharacters.idSectionMarker .InsertionPoints.Item(1).Contents = idSpecialCharacters.idEmSpace .InsertionPoints.Item(1).Contents = idSpecialCharacters.idAutoPageNumber .Paragraphs.Item(1).Justification = idJustification.idLeftAlign End With End With Rem Set up the right page (recto). With .Pages.Item(2) With .MarginPreferences .ColumnCount = 3 .ColumnGutter = "1p" .Bottom = "6p" Rem "left" means inside "right" means outside. .Left = "6p" .Right = "4p" .Top = "4p" End With Rem Add a simple footer with a section number and page number. With .TextFrames.Add .GeometricBounds = Array("61p", "6p", "62p", "47p") .InsertionPoints.Item(1).Contents = idSpecialCharacters.idAutoPageNumber .InsertionPoints.Item(1).Contents = idSpecialCharacters.idEmSpace .InsertionPoints.Item(1).Contents = idSpecialCharacters.idSectionMarker .Paragraphs.Item(1).Justification = idJustification.idRightAlign End With End With End With To apply a master spread to a document page, use the AppliedMaster property of the document page: Rem ApplyMaster.vbs Rem An InDesign CS2 VBScript Rem Applies a master spread to a page. Set myInDesign = CreateObject("InDesign.Application.CS2") Rem Assumes that the active document has a master page named "B-Master" Rem and at least two pages. myInDesign.ActiveDocument.Pages.Item(2).AppliedMaster = myInDesign.ActiveDocument.MasterSpreads. Item("B-Master")