The ExtendScript Toolkit (ESTK)

Scripts are plain text files that can be written in any text editor that can save files as plain text (BBEdit, Notepad), but we’ll use the ESTK as it’s a dedicated editor for writing JavaScripts and it comes free with InDesign. The ESTK can be started as we did in the previous section, namely, by choosing to edit an existing script in the Scripts panel. And indeed if you want to change an existing script, that’s a convenient way.

But in the long run it’s easier to launch the ESTK as an independent application. The application can be found in Program Files/Adobe/Adobe Utilities/. I have a shortcut to the program (ExtendScript Toolkit.exe) on my desktop so I can launch it easily.

When saving a script, you can use any name, but you must use the extension .jsx. Where to save your script depends on your operating system; see the box “Where to Save Scripts” for details.

When the ESTK has launched you see it displayed on your screen as shown in Figure 2. The layout of the different windows and panels will differ. We’ll not go into great detail here; see Help → JavaScript Toolsguide CS5, chapter 2, for a detailed introduction into the ESTK. Here, we’ll discuss just some basic features.

Like in InDesign, documents in the ESTK are displayed in the main window in tabs with each document’s name displayed in the tab. The first time you start the ESTK, several panels are opened as well. For our purposes the most important panel is the Console. This is the panel that ...

Get Scripting InDesign CS3/4 with JavaScript now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.