Scripting in FrameMaker

Understand how to create and execute ExtendScript scripts to automate repetitive tasks in Adobe FrameMaker.

In this topic

What is scripting?

Scripting is a powerful tool to control and automate many features of Adobe FrameMaker. Scripting in FrameMaker is based on Adobe ExtendScript. It is a dialect of the ECMAScript 3 standard and, therefore, similar to JavaScript.

Why use scripting?

Your work is characterized by creativity, but many of the actual hands-on tasks are anything but creative. Most likely, you spend much time doing the same or similar procedures over and over again. Would it not be great to have an assistant—one that happily does the mind-numbing tasks, follows your instructions with perfect and predictable consistency, is available any time you need help, works at lightning speed, and never even sends an invoice? Scripting can be that assistant. With a small investment of time, you can learn to script the simple but repetitive tasks that eat up your time. However, while it’s easy to get started, FrameMaker scripts provide the necessary depth to handle sophisticated jobs. As your scripting skills grow, you may move on to more complex scripts that work all night while you’re sleeping.

Getting started with scripting

A script is a series of statements that tell an application to perform a set of tasks. The trick is writing the statements in a language that the applications understand. FrameMaker supports ExtendScript as its scripting language.

There are two ways of running scripts: from within FrameMaker and by using the ExtendScript Toolkit (ESTK).

Create scripts

FrameMaker includes a menu entry that makes it easy to create a script with the ExtendScript Toolkit (ESTK).

To create a script:

  1. Click File > Script > New Script.

  2. Compose your script in the ExtendScript Toolkit (ESTK) that is opened.

  3. Save the script. Either run the script from within ESTK or run it from within FrameMaker.

Run scripts

FrameMaker includes a menu entry that makes it easy to run scripts.

To run a script:

  1. Click File > Script > Run. The Choose Script... dialog is displayed.

  2. In the Choose Script... dialog, select the script type ( *.jsx, *.js, *.jsxbin) to be displayed in the file list.

  3. Select the script that you want to run.

  4. Click Open. FrameMaker runs the script.