Adobe 27510753 Scripting Guide - Page 157
Changing the pasteboard's appearance
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 157 highlights
Adobe InDesign CS2 Scripting Guide Working with Documents in VBScript 149 Rem The following assumes that your default master spread contains two pages. With myDocument.MasterSpreads.Item(1).Pages.Item(1).MarginPreferences .Top = 0 .Left = 0 .Bottom = 0 .Right = 0 .ColumnCount = 1 .ColumnGutter = 0 End With With myDocument.MasterSpreads.Item(1).Pages.Item(2).MarginPreferences .Top = 0 .Left = 0 .Bottom = 0 .Right = 0 .ColumnCount = 1 .ColumnGutter = 0 End With myDocument.DocumentPreferences.PageHeight = "1p" myDocument.DocumentPreferences.PageWidth = "6p" Alternatively, you can change the application default margin preferences before you create the document: Rem ApplicationPageMargins.vbs Rem An InDesign CS2 VBScript Rem Sets the application default page margins. All new documents Rem will be created using these settings. Existing documents Rem will be unaffected. Set myInDesign = CreateObject("InDesign.Application.CS2") With myInDesign.MarginPreferences Rem Save the current application default margin preferences. myY1 = .Top myX1 = .Left myY2 = .Bottom myX2 = .Right Rem Set the application default margin preferences. .Top = 0 .Left = 0 .Bottom = 0 .Right = 0 End With Rem Create a new example document to demonstrate the change. Set myDocument = myInDesign.Documents.Add myDocument.DocumentPreferences.PageHeight = "1p" myDocument.DocumentPreferences.PageWidth = "6p" Rem Reset the application default margin preferences to their former state. With myInDesign.MarginPreferences .Top = myY1 .Left = myX1 .Bottom = myY2 .Right = myX2 End With Changing the pasteboard's appearance The pasteboard is an area that surrounds InDesign pages. You can use it for temporary storage of page items. You can change the size of the pasteboard and its color using scripting. The PasteboardColor property controls the color of the pasteboard in Normal mode; the PreviewBackgroundColor property sets the color of the pasteboard in Preview mode: Rem PasteboardPreferences.vbs Rem An InDesign CS2 VBScript Rem Create a new document and change the size of the pasteboard. Set myInDesign = CreateObject("InDesign.Application.CS2") Set myDocument = myInDesign.Documents.Add With myDocument.PasteboardPreferences