Setting Page Margins And Columns - Adobe 27510753 - InDesign CS2 - PC Manual

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

Advertisement

80
Working with Documents in AppleScript
set myDocument to make document
--The bleed properties belong to the document preferences object.
tell document preferences of myDocument
--Slug
set document slug uniform size to true
set slug top offset to "3p"
end tell
end tell
In addition to setting the bleed and slug widths and heights, you can control the color used to draw the
guides defining the bleed and slug. This property is not in the document preferences object—instead, it's
in the pasteboard preferences object:
--BleedSlugGuideColors.as
--An InDesign CS2 AppleScript
--Shows how to set the colors used to display the bleed and slug areas.
tell application "Adobe InDesign CS2"
--Assumes you have a document open.
tell pasteboard preferences of active document
--Any of InDesign's guides can use the UIColors constants...
set bleed guide color to cute teal
set slug guide color to charcoal
--...or you can specify a list of RGB values (with values from 0 to 255)
set bleed guide color to {0, 198, 192}
set slug guide color to {192, 192, 192}
end tell
end tell

Setting page margins and columns

Each page in a document can have its own margin and column settings. With InDesign scripting, these
properties are part of the margin preferences object for each page. This example script creates a new
document, then sets the margins and columns for all pages in the master spread:
--PageMargins.as
--An InDesign CS2 AppleScript
--Shows how to set the margins of a new document.
tell application "Adobe InDesign CS2"
set myDocument to make document
tell view preferences of myDocument
set horizontal measurement units to points
set vertical measurement units to points
end tell
tell master spread 1 of myDocument
tell margin preferences of pages
set top to 36
set left to 36
set bottom to 48
set right to 36
end tell
end tell
end tell
To set the page margins for an individual page, use the margin preferences for that page, as shown in the
following example:
--PageMarginsForOnePage.as
--An InDesign CS2 AppleScript
--Shows how to set the margins of a single page in a new document.
tell application "Adobe InDesign CS2"
set myDocument to make document
tell view preferences of myDocument
set horizontal measurement units to points
set vertical measurement units to points
end tell
tell margin preferences of page 1 of myDocument
Adobe InDesign CS2 Scripting Guide

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents