Changing The Pasteboard's Appearance; Using Guides And Grids; Defining Guides - Adobe 27510753 - InDesign CS2 - PC Manual

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

Advertisement

Adobe InDesign CS2 Scripting Guide
//Create a new example document to demonstrate the change.
var myDocument = app.documents.add();
myDocument.documentPreferences.pageHeight = "1p";
myDocument.documentPreferences.pageWidth = "6p";
//Reset the application default margin preferences to their former state.
with (app.marginPreferences){
top = myY1;
left = myX1 ;
bottom = myY2;
right = myX2;
}

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:
//PasteboardPreferences.jsx
//An InDesign CS2 JavaScript
//Create a new document and change the size of the pasteboard.
myDocument = app.documents.add();
with(myDocument.pasteboardPreferences){
//You can use either a number or a measurement string
//to set the space above/below.
minimumSpaceAboveAndBelow = "12p";
//You can set the pasteboard color to any of
//the predefined UIColor enumerations...
pasteboardColor = UIColors.white;
previewBackgroundColor = UIColors.gray;
//...or you can specify an array of RGB values
//(with values from 0 to 255)
//pasteboardColor = [0, 0, 0];
//previewBackgroundColor = [192, 192, 192];
}

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:
//Guides.jsx
//An InDesign CS2 JavaScript
//Create a new document, add guides, and set guide properties.
var myDocument = app.documents.add();
var myPageWidth = myDocument.documentPreferences.pageWidth;
var myPageHeight = myDocument.documentPreferences.pageHeight;
with(myDocument.pages.item(0)){
//Place guides at the margins of the page.
guides.add(undefined, {orientation:HorizontalOrVertical.vertical, location:marginPreferences.
left});
guides.add(undefined, {orientation:HorizontalOrVertical.vertical, location:(myPageWidth -
marginPreferences.right)});
guides.add(undefined, {orientation:HorizontalOrVertical.horizontal, location:marginPreferences.
top});
Working with Documents in JavaScript
117

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents