Deploying scripts in a Typefi workflow


In this brief webinar from the DO MORE with Scripting series, Peter Kahrel demonstrates how to deploy scripts in Typefi workflows, and highlights the significant improvements that have been made to script deployment functionality in Typefi 8.4.


The deployment of scripts in a Typefi job has changed dramatically in Typefi Server 8.4—it has become much simpler. In fact, using scripts in Server 8.4 (and later) is so much easier than in earlier versions that it alone is worth the upgrade.

In this webinar we’ll show you how it’s done. However, we’ll also demonstrate deployment in older Typefi Server versions (Typefi 8.3 and earlier) because there are still quite a few installations around.

Deploying scripts in Typefi 8.4 (0:34)

In Typefi Server 8.4, you can copy scripts to the server in the same way that you copy any other file. It doesn’t matter where the scripts are.

You can create a single scripts folder, which is fine if you use just a small handful of scripts. However, if you use many scripts at different events, then it might be useful to create folders for each event that you have scripts for.

For example, you could create a PageEnd folder and place all page.end scripts in it, and a DocumentEnd folder for document.end scripts. It’s entirely up to you.

Once the scripts are in place, specify them in the action. Go to the Create InDesign Document action or the Create InDesign Book action. Then go to the Event scripts tab, where you see the events that we explained earlier. Files are inserted in the usual way.

To add, for example, a page.end script, click the folder icon and navigate to the script you uploaded, select it and click Choose. The script’s name is inserted in the Page end field.

Scripts are run in the order in which you see them. To change the order of two or more scripts, simply drag them around with the mouse.

You can also add several scripts at once, and they will display alphabetically by default. For this reason, we often use two-digit prefixes for script names so we know the order in which they should appear. For example:

  • 20_KeepFloatInSection.jsxbin
  • 30_BalancePages.jsxbin

The two-digit prefixes are also useful when troubleshooting—if you remove a script to run some tests and then want to add it back in, it’s easy to see where it goes—or if you want to add an additional script in between existing scripts.

Deploying scripts in Typefi 8.3 or earlier (06:45)

In Typefi Server versions before 8.4, things are a bit different. To install a script, go to InDesign’s Scripts Panel folder.

In a Desktop installation you can find the folder as follows. In InDesign, open the Scripts panel, then right-click Application. Select Reveal in Explorer (or Reveal in Finder on Mac), which opens the operating system’s file manager with the script folder selected.

The folder’s name is Scripts Panel. For each script event that you use, create a folder in the Scripts Panel folder. For example, to use two page.end scripts and a document.end script, add a folder called PageEnd and one called DocumentEnd.

You must use this naming convention to match the Script event fields in Typefi (although the names are not case-sensitive).

Then you can add the event scripts in their respective folders. Be aware that scripts in a folder are run in alphabetical order. The clearest way to impose an execution order and to recognise it, is the use of numerical prefixes for your script files as mentioned earlier, for example:

  • 20_KeepFloatInSection.jsxbin
  • 30_BalancePages.jsxbin

Without the prefixes, BalancePages would run before KeepFloatInSection.

You then need a so-called event handler script. RunEventScripts.jsxbin is provided by Typefi. Place it in the Scripts Panel folder as well.

To specify scripts in an action, go to a workflow’s Create InDesign Document action. Go to the Event scripts tab and enter the the handler’s name in all events that you have scripts for, and click Run.

On remote servers the procedure is the same.

Note that as far as script deployment is concerned, the difference between Server 8.4 and earlier versions is only in the deployment—the scripts themselves need no change, so when you upgrade to Server 8.4 (which is highly recommended) you can use the same scripts.

< Previous webinarNext webinar >

About Peter Kahrel

Peter was born in Amsterdam, the Netherlands. He trained as a linguist at the University of Amsterdam and has an MA and a PhD, specialising in syntax, semantics, and typology. He has lived in the UK since 1994, working as a typesetter, editor, copy-editor, and indexer (and sometimes as a designer too) for publishers in the UK, the Netherlands, and Germany, preparing for the press both books and journals. He combined this with teaching at the Linguistics Department at Lancaster University.

Peter has been programming InDesign with JavaScript since 2003, mainly to cut out the tedium that faces every typesetter and indexer but in equal measure because it’s good fun. Peter has worked as a script developer at Typefi since 2010, and is highly regarded in the global InDesign scripting community.

Check out Peter’s website—which includes a bunch of free scripts—at CreativePro.