Why Use Scripting; What About Macros - Adobe 27510753 - InDesign CS2 - PC Manual

Scripting guide
Hide thumbs Also See for 27510753 - InDesign CS2 - PC:
Table of Contents

Advertisement

6
Scripting Basics
On the Macintosh, scripting is often accomplished using AppleScript, a scripting system that sends messages
to applications or to the operating system using AppleEvents. In Windows, VBScript programs use a similar
system for interapplication communication, usually referred to as Windows Automation. JavaScripts, by
contrast, run on either platform. The terminology differs among the scripting languages, but the idea is the
same—to send information from one program (the scripting system) to another program (InDesign) to make
the receiving application perform some task.
Not all applications can be controlled by scripts. For scripting to work, an application has to receive messages
from another application, and has to be able to turn those messages into actions. In addition, the messages
you send to an application have to be constructed in a particular way, or the application can't understand
what you want it to do.
This book is a kind of "language lesson"—it shows you how to talk to InDesign.

Why use scripting?

Graphic design is a field characterized by creativity, but most of the actual work of page layout is not creative.
When you think about the work that you do, chances are good that you'll find that you spend most of your
time doing the same or similar production tasks, over and over again. In fact, you'll probably notice that the
time you spend placing and replacing images, correcting errors in text, and preparing files for printing at an
image-setting service provider often reduces the time that you have available for doing creative work.
Wouldn't it be wonderful to have an assistant—one who would do some or all of the boring, repetitive tasks
for you? Then you'd have more time to concentrate on the creative aspects of your work.
With a small investment of time, InDesign scripting can be your page-layout assistant. You can start with
short, simple scripts that save you a few seconds every day, and move on to scripts that work all night while
you're sleeping.
Think about your work—is there a repetitive task that's annoying you? If so, you've identified a candidate for
a script. Think analytically about the task. What are the steps involved in performing the task? What are the
conditions in which you need to do the task? After you understand the process that you go through, you can
turn it into a script.

What about macros?

A macro is a recording of a series of user-interface actions—menu choices, key presses, and mouse
movements. When you run a macro, the macro performs all the recorded actions. You create macros using
special utility programs. QuicKeys, from CE Software, is an example of a macro-creating program.
Many people are confused about the difference between a macro and a script. Macros and scripts are both
ways of automating repetitive tasks, but they work very differently. The following points summarize the key
differences.
Macros use a program's user interface to do their work. As a macro runs, it displays and closes dialog
l
boxes, pulls down menus, makes menu choices, and types text into documents or fields. Scripts do not use
a program's user interface to perform their tasks, and they execute much faster than the fastest macro.
Macros have very limited facilities for getting and responding to information from a program. Scripts can
l
get information and then make decisions and calculations based on the information that they receive.
Note:
In Microsoft Word, Excel, and some other Microsoft Office applications, macros are recordings of user
actions written as scripts, which can be edited to add scripting features. These macros are not the type
of macro we're describing in the preceding text, and InDesign does not have the ability to record user
actions as a script.
Adobe InDesign CS2 Scripting Guide

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Indesign cs2

Table of Contents