Values And Variables; Values - 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
AppleScript
first text frame of the first spread of the first document
Note:
When your AppleScript refers to a text object, InDesign returns the text contained in the object—not a
reference to the object itself. To get a reference to the text object, use the object reference property, as
shown in this example:
tell application "Adobe InDesign CS2"
set myDocument to make document
tell spread 1 of myDocument
set myTextFrame to make text frame
set contents of myTextFrame to "InDesign"
--The following line returns the text "InDesign"
get paragraph 1 of myTextFrame
--The following line returns a text object
get object reference of paragraph 1 of myTextFrame
end tell
end tell
VBScript
Documents.Item(1).Spreads.Item(1).TextFrames.Item(1)
JavaScript
app.documents.item(0).spreads.item(0).textFrames.item(0)

Values and variables

Scripts become particularly useful when you can specify exact data (values) and use variables (containers for
data).

Values

The point size of a character of text, the horizontal location of a text frame on a page, or the color of stroke of
a rectangle are all examples of values used in InDesign scripting. Values are the data that your scripts use to
do their work.
The type of a value defines what sort of data the value contains. The value type of the contents of a word, for
example, is a text string; the value type of the leading of a paragraph is a number. Usually, the values used
in scripts are numbers or text. The following table explains the value types most commonly used in InDesign
scripting.
Value type
Boolean
Integer
What it is
Logical True or False
Whole numbers (no decimal points).
Integers can be positive or negative.
In VBScript, you can use the long data
type for integers. In AppleScript, you
can also use the fixed or long data types
for both integers and real numbers.
Scripting Basics
Example
True
14
9

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents