Adobe 27510753 Scripting Guide - Page 13

Scripting Basics, Introduction to scripting, What is scripting?

Page 13 highlights

Adobe InDesign CS2 Scripting Guide Scripting Basics 5 2 Scripting Basics If you've used InDesign, you've worked with frames and their contents, and you've learned to apply colors, formatting, and styles. You've set up publications, spreads, pages, and the design elements on those pages. If you've done all of this, you've gotten used to thinking of an InDesign publication as a collection of objects. InDesign scripting uses the same approach. The core of InDesign scripting is the object model: a description of all the types of items-documents, spreads, pages, frames, and the contents of those frames-that can appear in an InDesign publication. Each type of object has its own special properties, and every object in an InDesign publication has its own identity. Not every InDesign user will be familiar with programming terms, concepts, and techniques, so this chapter provides introductory information to help get you started with scripting. It covers the basic concepts of scripting, or programming, for both Windows and the Macintosh. For more detailed directions on using your scripting system with InDesign, see Chapter 3, "Getting Started with InDesign Scripting." Experienced scripters might want to skip directly to that chapter. Introduction to scripting Scripting isn't only for software engineers-it's for every InDesign user. You don't need a degree in computer science or mathematics to write scripts that can automate a wide variety of common page-layout tasks in InDesign. If you can read this text, you can write InDesign scripts. What is scripting? A script is a series of commands that tells InDesign to perform a series of actions. These actions can be simple and affect only a single, selected object in the current publication; or complex and affect all of the objects in all of the InDesign publications on your hard drive. The actions might involve only InDesign, or they might involve other applications, such as word processors, spreadsheets, and database management programs. Virtually every task that you can perform by manipulating InDesign's tools, menus, palettes, and dialog boxes can be performed by a script. Scripting is a way to automate repetitive tasks, but it can also be a creative tool. In addition to performing routine production tasks, such as preparing a set of publications for remote printing, you can use scripts for creative tasks that would be too difficult or too time consuming to do yourself. For example, you could write a script to randomly change the font and color of the characters in a selection, or to gradually increase the size and baseline shift of characters from one end of a range of text to the other. Without scripting, you might not use these creative effects.

  • 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
Scripting Basics
5
2
Scripting Basics
If you’ve used InDesign, you’ve worked with frames and their contents, and you’ve learned to apply colors,
formatting, and styles. You’ve set up publications, spreads, pages, and the design elements on those pages. If
you’ve done all of this, you’ve gotten used to thinking of an InDesign publication as a collection of objects.
InDesign scripting uses the same approach. The core of InDesign scripting is the object model: a description
of all the types of items—documents, spreads, pages, frames, and the contents of those frames—that can
appear in an InDesign publication. Each
type
of object has its own special properties, and every
object
in an
InDesign publication has its own identity.
Not every InDesign user will be familiar with programming terms, concepts, and techniques, so this chapter
provides introductory information to help get you started with scripting. It covers the basic concepts of
scripting, or programming, for both Windows and the Macintosh. For more detailed directions on using your
scripting system with InDesign, see Chapter 3, “Getting Started with InDesign Scripting.” Experienced scripters
might want to skip directly to that chapter.
Introduction to scripting
Scripting isn’t only for software engineers—it’s for every InDesign user. You don’t need a degree in computer
science or mathematics to write scripts that can automate a wide variety of common page-layout tasks in
InDesign. If you can read this text, you can write InDesign scripts.
What is scripting?
A script is a series of commands that tells InDesign to perform a series of actions. These actions can be simple
and affect only a single, selected object in the current publication; or complex and affect all of the objects in
all of the InDesign publications on your hard drive. The actions might involve only InDesign, or they might
involve other applications, such as word processors, spreadsheets, and database management programs.
Virtually every task that you can perform by manipulating InDesign’s tools, menus, palettes, and dialog boxes
can be performed by a script.
Scripting is a way to automate repetitive tasks, but it can also be a creative tool. In addition to performing
routine production tasks, such as preparing a set of publications for remote printing, you can use scripts for
creative tasks that would be too difficult or too time consuming to do yourself. For example, you could write a
script to randomly change the font and color of the characters in a selection, or to gradually increase the size
and baseline shift of characters from one end of a range of text to the other. Without scripting, you might not
use these creative effects.