Adobe 27510753 - InDesign CS2 - PC Manual page 136

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

Advertisement

128
Working with Documents in JavaScript
//Create up a pair of paragraph styles for the page footer text.
//These styles have only basic formatting.
try{
myDocument.paragraphStyles.item("footer_left").name;
}
catch (myError){
myDocument.paragraphStyles.add({name:"footer_left", pointSize:11, leading:14});
}
//Create up a pair of paragraph styles for the page footer text.
try{
myDocument.paragraphStyles.item("footer_right").name;
}
catch (myError){
myDocument.paragraphStyles.add({name:"footer_right", basedOn:myDocument.paragraphStyles.
item("footer_left"), justification:Justification.rightAlign, pointSize:11, leading:14});
}
//Create a layer for guides.
try{
myDocument.layers.item("GuideLayer").name;
}
catch (myError){
myDocument.layers.add({name:"GuideLayer"});
}
//Create a layer for the footer items.
try{
myDocument.layers.item("Footer").name;
}
catch (myError){
myDocument.layers.add({name:"Footer"});
}
//Create a layer for the slug items.
try{
myDocument.layers.item("Slug").name;
}
catch (myError){
myDocument.layers.add({name:"Slug"});
}
//Create a layer for the body text.
try{
myDocument.layers.item("BodyText").name;
}
catch (myError){
myDocument.layers.add({name:"BodyText"});
}
with(myDocument.viewPreferences){
rulerOrigin = RulerOrigin.pageOrigin;
horizontalMeasurementUnits = MeasurementUnits.points;
verticalMeasurementUnits = MeasurementUnits.points;
}
//Document baseline grid and document grid
with(myDocument.gridPreferences){
baselineStart = 56;
baselineDivision = 14;
baselineShown = false;
horizontalGridlineDivision = 14;
horizontalGridSubdivision = 5
verticalGridlineDivision = 14;
verticalGridSubdivision = 5
documentGridShown = false;
}
//Document XMP information.
with (myDocument.metadataPreferences){
author = "Olav Martin Kvern";
copyrightInfoURL = "http://www.adobe.com";
copyrightNotice = "This document is not copyrighted.";
copyrightStatus = CopyrightStatus.no;
description = "Example 7 x 9 book layout";
Adobe InDesign CS2 Scripting Guide

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents