Adobe 27510753 - InDesign CS2 - PC Manual page 159

Scripting guide
Hide thumbs Also See for 27510753 - InDesign CS2 - PC:
Table of Contents

Advertisement

Adobe InDesign CS2 Scripting Guide
Set myDocument = myInDesign.Documents.Add
myDocument.DocumentPreferences.FacingPages = True
myDocument.DocumentPreferences.PagesPerDocument = 3
With myDocument.Spreads.Item(2)
Rem Note the difference between these two guides on pages 2 and 3.
With .Guides.Add
.Orientation = idHorizontalOrVertical.idHorizontal
.Location = "6p"
.FitToPage = True
End With
With .Guides.Add
.Orientation = idHorizontalOrVertical.idHorizontal
.Location = "9p"
.FitToPage = False
End With
End With
You can use scripting to change the layer, color, and visibility of guides, just as you can from the user interface.
Rem GuideOptions.vbs
Rem An InDesign CS2 VBScript
Rem Shows how to set guide options.
Set myInDesign = CreateObject("InDesign.Application.CS2")
Set myDocument = myInDesign.Documents.Add
Rem Create a layer named "guide layer".
Set myLayer = myDocument.Layers.Add
myLayer.Name = "guide layer"
Rem Add a series of guides to page 1.
With myDocument.Pages.Item(1)
Rem Create a guide on the layer we created above.
With .Guides.Add(myLayer)
.Orientation = idHorizontalOrVertical.idHorizontal
.Location = "12p"
End With
Rem Another way to make a guide on a specific layer.
With .Guides.Add()
.ItemLayer = myLayer
.Orientation = idHorizontalOrVertical.idHorizontal
.Location = "14p"
End With
Rem Make a locked guide.
With .Guides.Add()
.ItemLayer = myLayer
.Orientation = idHorizontalOrVertical.idHorizontal
.Location = "16p"
.Locked = True
End With
Rem Set the view threshold of a guide.
With .Guides.Add()
.ItemLayer = myLayer
.Orientation = idHorizontalOrVertical.idHorizontal
.Location = "18p"
.ViewThreshold = 100
End With
Rem Set the guide color of a guide using a UIColors constant.
With .Guides.Add()
.ItemLayer = myLayer
.Orientation = idHorizontalOrVertical.idHorizontal
.Location = "18p"
.GuideColor = idUIColors.idGray
End With
Working with Documents in VBScript
151

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents