Constructing a document. Adobe CS5 Server
Anúncio
Anúncio
Adobe InDesign CS5 Server Scripting Guide
Constructing a document 17
Constructing a document
.
Obviously, our “Hello World!” script is not very useful in your daily work. While you can use an InDesign script at any point in your production process, we start by creating scripts that start at the same point you do—creating new documents, setting page margins, and creating and applying master pages. The following figure shows the objects with which we will work.
document viewPreferences horizontalMeasurementUnits verticalMeasurementUnits rulerOrigin masterSpreads.item(0) pages.item(0) marginPreferences top left bottom right columnCount columnGutter
In this section, we create one long script by adding short blocks of scripting code. Each block demonstrates a specific area or task in InDesign Server scripting. As you enter each block, you can run the script to see what happens. If you are using AppleScript, you will need to add the text end tell
to the end of the script before you run it, then remove the text before continuing.
N
OTE
: The preceding figure uses the JavaScript version of the scripting terms. For AppleScript, you would add spaces between words ( view preferences
, rather than viewPreferences
). For VBScript, you would use an item index starting at 1, rather than 0 ( masterSpreads.item(1)
, rather than masterSpreads.item(0)
).
Setting up measurement units and master spread margins
The following script shows how to create a new document and set the margins of the first master spread.
In this section, we show how to build a complex script using simple building blocks of scripting code. Start your script editor and enter the following lines in the scripting language of your choice.
Download
Anúncio