Adobe 27510753 Scripting Guide - Page 158
Using guides and grids, Defining guides
UPC - 718659445294
View all Adobe 27510753 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 158 highlights
150 Working with Documents in VBScript Adobe InDesign CS2 Scripting Guide Rem You can use either a number or a measurement string to set the space above/below. .MinimumSpaceAboveAndBelow = "12p" Rem You can set the preview background color (which you'll only see Rem in Preview mode) to any of the predefined UIColor constants... .PreviewBackgroundColor = idUIColors.idGrassGreen Rem ...or you can specify an array of RGB values (with values from 0 to 255) Rem .PreviewBackgroundColor = Array(192, 192, 192) End With Using guides and grids Guides and grids make it easy to position objects on your document pages. Defining guides A guide in InDesign gives you an easy way to position objects on the pages of your document. Here's an example use of guides: Rem Guides.vbs Rem An InDesign CS2 VBScript Rem Create a new document, add guides, and set guide properties. Set myInDesign = CreateObject("InDesign.Application.CS2") Set myDocument = myInDesign.Documents.Add myPageWidth = myDocument.DocumentPreferences.PageWidth myPageHeight = myDocument.DocumentPreferences.PageHeight With myDocument.Pages.Item(1) Set myMarginPreferences = .MarginPreferences Rem Place guides at the margins of the page. With .Guides.Add .Orientation = idHorizontalOrVertical.idVertical .Location = myMarginPreferences.Left End With With .Guides.Add .Orientation = idHorizontalOrVertical.idVertical .Location = (myPageWidth - myMarginPreferences.Right) End With With .Guides.Add .Orientation = idHorizontalOrVertical.idHorizontal .Location = myMarginPreferences.Top End With With .Guides.Add .Orientation = idHorizontalOrVertical.idHorizontal .Location = (myPageHeight - myMarginPreferences.Bottom) End With Rem Place a guide at the vertical center of the page. With .Guides.Add .Orientation = idHorizontalOrVertical.idVertical .Location = (myPageWidth / 2) End With Rem Place a guide at the horizontal center of the page. With .Guides.Add .Orientation = idHorizontalOrVertical.idHorizontal .Location = (myPageHeight / 2) End With End With Horizontal guides can be limited to a given page, or can extend across all pages in a spread. With InDesign scripting, you can control this using the FitToPage property. (This property is ignored by vertical guides.) Rem SpreadAndPageGuides.vbs Rem An InDesign CS2 VBScript Rem Demonstrates the difference between spread guides and page guides. Set myInDesign = CreateObject("InDesign.Application.CS2")