11
2
Scripting Features
This chapter covers scripting techniques related to InDesign’s scripting environment. Almost every other
object in the InDesign scripting model controls a feature that can change a document or the application
defaults. By contrast, the features in this chapter control how scripts operate.
This document discusses the following:
X The scriptPreferences object and its properties.
X Getting a reference to the executing script.
X Running scripts in prior versions of the scripting object model.
X Using the doScript method to run scripts.
X Working with script labels.
X Running scripts at InDesign start-up.
X Controlling the ExtendScript engine in which scripts execute.
We assume you already read Adobe InDesign CS5 Scripting Tutorial and know how to write, install, and run
InDesign scripts in the scripting language of your choice.
Script Preferences
The scriptPreferences object provides objects and properties related to the way InDesign runs scripts.
The following table provides more detail on each property of the scriptPreferences object:
Property Description
enableRedraw
Turns screen redraw on or off while a script is running from the Scripts panel.
scriptsFolder
The path to the scripts folder.
scriptsList
A list of the available scripts. This property is an array of arrays, in the
following form:
[[fileName, filePath], ...]
Where fileName is the name of the script file and filePath is the full path to
the script. You can use this feature to check for the existence of a script in the
installed set of scripts.