Setting Up Measurement Units And Master Spread Margins; Applescript; Javascript - Adobe 65024872 - InDesign CS4 - Mac Manual

Scripting guide
Hide thumbs Also See for 65024872 - InDesign CS4 - Mac:
Table of Contents

Advertisement

Adobe InDesign CS4 Scripting Tutorial

Setting up measurement units and master spread margins

The following script fragment shows how to create a new document and set the margins of the first master
spread.

AppleScript

tell application "Adobe InDesign CS4"
--Create a new document.
set myDocument to make document
--Set the measurement units and ruler origin.
set horizontal measurement units of view preferences to points
set vertical measurement units of view preferences to points
set ruler origin of view preferences to page origin
--Get a reference to the first master spread.
set myMasterSpread to master spread 1 of myDocument
--Get a reference to the margin preferences of the first page in the master spread.
tell margin preferences of page 1 of myMasterSpread
--Now set up the page margins and columns.
set left to 84
set top to 70
set right to 70
set bottom to 78
set column count to 3
set column gutter to 14
end tell
--Page margins and columns for the right-hand page.
tell margin preferences of page 2 of myMasterSpread
set left to 84
set top to 70
set right to 70
set bottom to 78
set column count to 3
set column gutter to 14
end tell

JavaScript

//Create a new document.
var myDocument = app.documents.add();
//Set the measurement units and ruler origin.
myDocument.viewPreferences.horizontalMeasurementUnits = MeasurementUnits.points;
myDocument.viewPreferences.verticalMeasurementUnits = MeasurementUnits.points;
myDocument.viewPreferences.rulerOrigin = RulerOrigin.pageOrigin;
//Get a reference to the first master spread.
var myMasterSpread = myDocument.masterSpreads.item(0);
//Get a reference to the margin preferences of the first page in the master spread.
var myMarginPreferences = myMasterSpread.pages.item(0).marginPreferences;
//Now set up the page margins and columns.
myMarginPreferences.left = 84;
myMarginPreferences.top = 70;
myMarginPreferences.right = 70;
myMarginPreferences.bottom = 78;
myMarginPreferences.columnCount = 3;
myMarginPreferences.columnGutter = 14;
Constructing a document 31

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs4

Table of Contents