Gilbert Consulting logo

Scripts for automating Adobe InDesign

One of the consulting services I provide is custom Script development for Adobe InDesign. If you find yourself banging your head against the wall wishing that InDesign would do such and such, or if you have a thorny workflow issue you'd like to solve with the Creative Suite, a script may be the answer. Contact me and I'll develop a script for you!

Learn more about the Digital publishing pack scripts for Adobe DPS and AEM Mobile, a package of scripts sure to make design and production of your interactive mobile apps easier!

Below are some free scripts that I've either developed for my own use, or that are small fragments of a larger client solution. Feel free to use these scripts, or to modify them for your own use.

Export FXL HTML (download)

This script will export non-facing pages InDesign files to “fixed layout” HTML format. That is, HTML that retains the exact layout, typography, animation, and appearance from your InDesign layout. The resulting export is very similar to InDesign’s fixed layout EPUB export, but instead of producing a fixed layout EPUB, a folder of HTML, CSS, and JavaScript is produced.

Setup (download)

This script sets all of InDesign's preferences and many panel options and view settings the way that I like them. You can edit the script to set the preferences to suit your workflow.

Export JPG (download)

These scripts make it easy to export a selection, a page, a range of pages, or an entire document to JPG format at a specific pixel dimension.

Paste and format URL (download)

This script will automate the process of creating visible URLs. Just copy a URL to the clipboard, choose an insertion point in your text, and run the script.

Export PNG with dimensions (download)

This script will output the currently selected objects to PNG format, prompting you for the desired width or height in pixels. This script works in CS6 or later only.

Check for flipped images (download)

This script will “preflight” the currently open file to see if any graphics have been flipped horizontally or vertically. If any flipped graphics are found, a report is created listing the flipped graphic filename, page number, and flip direction.

Package (download pre CC 2014)  (download for CC 2014 and newer)

This simple script does the same thing as the File > Package command, with two differences: first, it doesn't stop to allert you about preflight problems, and second, it doesn't create the "instructions.txt" file.

InteractivePDFSpreads ON/OFF (download)

A simple script that implements an un-exposed feature of InDesign CS5. When you export a facing-pages layout using the Adobe PDF (Interactive) option, the facing pages always output as a spread. When you run the InteractivePDFSpreadsOFF script, all future Interactive PDFs exported from InDesign will output as single pages, not spreads. To restore the ability to export spreads to Interactive PDF, run the InteractivePDFSpreadsON script.

SlideShow (download)

A real quick and dirty script that uses InDesign CS5's "Presentation Mode" to display all the pages of the open document as a self-running "slide show". Here is a French version, translated by Pierre Labbe.

TransposeTwoCharacters (download)

InCopy has a command to transpose two text characters (Edit > Transpose), but InDesign doesn't. This script fixes that. Just place the text cursor between two characters, and double-click on the script in the Scripts panel. Even better, use the Keyboard Shortcut editor to assign a keyboard shortcut to the script, so you can transpose two characters with a keystroke.

Update: Here is a version for InCopy. Even though InCopy has a Transpose command, it doesn't work to transpose certain characters, such as periods and quotation marks. This script works to transpose all characters. See this InCopySecrets post.

BalanceRaggedLines (download)

This script "exposes" a hidden feature of InDesign CS3 - CS5: the ability to control how the Balance Ragged Lines feature works. By default, the Balance Ragged Lines feature will try to make the lines in the selection approximately the same length, favoring a longer first line and a shorter second line. With this script you can tell InDesign to favor a shorter first line and a longer second line, or to try to make all lines the same length. See the enclosed documentation and example files for more detailed information.

Tooltip (download)

Back in 2007 I wrote an article for InDesign Magazine on how to add PDF tooltips to an InDesign CS3 file.

In InDesign CS4, Adobe completely reworked the way that buttons are created and edited. The change was for the better, except that in the process, Adobe removed the dialog box that allowed you to enter and edit tooltips. The underlying code for handling tooltips is still in CS4, but the dialog box for viewing, editing and adding tooltips is gone.

This script adds the functionality for viewing, editing and adding tooltip text to buttons back to InDesign CS4. See the enclosed documentation for more information. This script is no longer needed for CS5.