
Adobe InDesign CS4 Scripting Tutorial
Getting started
6
Installing scripts
Installing an InDesign script is easy: put the script file in the Scripts Panel folder inside the Scripts folder in
your InDesign application folder. (Create the Scripts folder if it does not already exist.)
Alternately, put the script inside the Scripts Panel folder in your preferences folder. Your preferences folder
is at:
Windows® XP:
~\Documents and Settings\
user_name
\Application Data\Adobe
\InDesign\Version 6.0\Scripts
Mac OS®:
~/Users/
user_name
/Library/Preferences/Adobe InDesign/Version 6.0/Scripts
where
~
is your system volume and
user_name
is your user name.
Once the script is in the folder, it appears on the Scripts panel inside InDesign. To display the panel, choose
Window > Automation > Scripts.
You also can put aliases/shortcuts to scripts (or to folders containing scripts) in the Scripts Panel folder, and
they will appear in the Scripts panel.
To run a specific script when InDesign starts, put the script inside a folder named “Startup Scripts” inside
the Scripts folder (create this folder if it does not already exist).
Running a script
To run a script, display the Scripts panel (choose Window > Automation > Scripts), then double-click the
script name in the Scripts panel. Many scripts display user-interface items (like dialog boxes or panels) and
display alerts if necessary.
Using the scripts panel
The InDesign Scripts panel is the easiest and best way to run most InDesign scripts. If the panel is not
already visible, you can display it by choosing Window > Automation > Scripts.
Scripts run from the Scripts panel run faster than scripts run from the Finder (Mac OS
®
) or Explorer
(Windows
®
).
Another way to make scripts run faster is to turn off screen redraw while the script is running. To do this,
turn on the Enable Redraw from the Scripts panel menu. To view the script actions as they execute, turn
this option off.
The Scripts panel can run compiled or uncompiled AppleScripts (files with the file extension
.spt
,
.as
, or
.applescript
), JavaScripts (files with the file extension
.js
or
.jsx
), VBScripts (files with the extension
.vbs
), or executable programs from the Scripts panel.
To edit a script shown in the Scripts panel, select the script and choose Edit Script from the Scripts panel
menu. Alternatively, you can hold down Option (Mac OS) or Alt (Windows) key and double-click the script’s
name. This opens the script in the editor you defined for the script file type.
To open the folder containing a script shown in the Scripts panel, select the script and choose Reveal in
Finder (Mac OS) or Reveal in Explorer (Windows). Alternatively, you can hold down the Command (Mac OS)
or Ctrl-Shift (Windows) keys and double-click the script’s name. The folder containing the script opens in
the Finder (Mac OS) or Explorer (Windows).