Adobe 27510753 Scripting Guide - Page 29

The InDesign document object model, Looking at the InDesign object model

Page 29 highlights

Adobe InDesign CS2 Scripting Guide Getting Started with InDesign Scripting 21 The InDesign document object model This section provides a rough outline of some of the key object types and hierarchy within InDesign: l Application: Preferences (of various sorts) l Application: Defaults (Colors, ParagraphStyles, and so on--application default objects apply all new documents) l Application: Documents (collection of open documents) l Document: Preferences (of various sorts) l Document: Defaults (Colors, ParagraphStyles, and so on--document default objects) l Document: Spreads/Pages l Spread/Page: PageItems (Rectangles, Ovals, Polygons, GraphicLines, TextFrames, etc.) l Document: Stories (The text in the document) l Story: Text objects (Paragraphs, Words, Characters, Lines, and so on--the text in the story) l A button is a page item (it's a way to add an interactive button to an exported PDF). l Application: Dialogs (script dialog boxes) (includes most of the other user interface gadgets (radio button controls, dropdowns, checkbox controls, and so on) for building modal dialog boxes) Looking at the InDesign object model Although the objects and commands available in InDesign are all documented in the InDesign CS2 Scripting Reference, you can also view them from inside your scripting system if you are using AppleScript or VBScript. JavaScript does not provide a way to view the InDesign object model. AppleScript To view the InDesign AppleScript dictionary: 1. Start InDesign and the Apple Script Editor. If you can't find the Script Editor, see "System Requirements" in the Introduction. 2. In the Script Editor, choose File > Open Dictionary. The Script Editor displays a standard Open File dialog box. 3. Select the InDesign application and click OK. The Script Editor displays a list of InDesign's objects and commands. You also can see the properties associated with each object. JavaScript and VBScript If you're using JavaScript or VBScript to write your InDesign scripts, you can't view the InDesign object model as you can in AppleScript or VBScript. Instead, refer to the corresponding chapter of the Adobe InDesign Scripting Reference.

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184

Adobe InDesign CS2 Scripting Guide
Getting Started with InDesign Scripting
21
The InDesign document object model
This section provides a rough outline of some of the key object types and hierarchy within InDesign:
Application: Preferences (of various sorts)
Application: Defaults (Colors, ParagraphStyles, and so on--application default objects apply all new
documents)
Application: Documents (collection of open documents)
Document: Preferences (of various sorts)
Document: Defaults (Colors, ParagraphStyles, and so on--document default objects)
Document: Spreads/Pages
Spread/Page: PageItems (Rectangles, Ovals, Polygons, GraphicLines, TextFrames, etc.)
Document: Stories (The text in the document)
Story: Text objects (Paragraphs, Words, Characters, Lines, and so on--the text in the story)
A button is a page item (it’s a way to add an interactive button to an exported PDF).
Application: Dialogs (script dialog boxes) (includes most of the other user interface gadgets (radio button
controls, dropdowns, checkbox controls, and so on)
for building modal dialog boxes)
Looking at the InDesign object model
Although the objects and commands available in InDesign are all documented in the
InDesign CS2 Scripting
Reference
, you can also view them from inside your scripting system if you are using AppleScript or VBScript.
JavaScript does not provide a way to view the InDesign object model.
AppleScript
To view the InDesign AppleScript dictionary:
1.
Start InDesign and the Apple Script Editor. If you can't find the Script Editor, see “System Requirements” in
the Introduction.
2.
In the Script Editor, choose File > Open Dictionary. The Script Editor displays a standard Open File dialog
box.
3.
Select the InDesign application and click OK. The Script Editor displays a list of InDesign’s objects and com-
mands. You also can see the properties associated with each object.
JavaScript and VBScript
If you’re using JavaScript or VBScript to write your InDesign scripts, you can't view the InDesign object model
as you can in AppleScript or VBScript. Instead, refer to the corresponding chapter of the
Adobe InDesign
Scripting Reference
.
l
l
l
l
l
l
l
l
l
l
l