Adobe InDesign CS2 Scripting Guide
Contents
i
Contents
1
Introduction
.................................................................
1
What is in this book
......................................................................................................
1
Who should read this book
........................................................................................
1
What you need to use scripting
...............................................................................
1
JavaScript
.....
�
2
Macintosh
....
�
2
Windows
......
�
2
How to use the scripts in this document
..............................................................
2
Copying examples with long lines
.....................................................................................
3
Running JavaScript files
.........................................................................................................
3
Where to find more information
..............................................................................
3
InDesign online scripting resources
..................................................................................
4
2
Scripting Basics
...........................................................
5
Introduction to scripting
............................................................................................
5
What is scripting?
......................................................................................................................
5
Why use scripting?
...................................................................................................................
6
What about macros?
................................................................................................................
6
Making script files readable
.......................................................................................
7
Commenting the script
..........................................................................................................
7
Continuing long lines in AppleScript and VBScript
.....................................................
7
Continuing long lines in JavaScript
....................................................................................
7
Objects and classes
......................................................................................................
8
Objects
.........
�
8
Object references
.....................................................................................................................
8
Values and variables
.....................................................................................................
9
Values
............
�
9
Variables
.....
�
10
Variable names
........................................................................................................................
11
Assigning values to variables
.............................................................................................
11
Array variables
.........................................................................................................................
12
Converting values from one type to another
..............................................................
12
Finding the value type of a variable
................................................................................
13
Operators
.......................................................................................................................
14
Methods
.........................................................................................................................
14