News + Events

Find out what's happening.

Posts Tagged ‘Scripting’

Promotional graphic with photo of Peter Kahrel, Typefi Senior Scripting Engineer, above a white logo for Typefi, and the title of the blog post.

Automate repetitive graphs and charts in InDesign with scripting

Peter Kahrel
Senior Scripting Engineer, Typefi

The adage ‘work smarter, not harder’ often comes to mind when composing documents. Thankfully, scripting can help save the day, as Typefi Senior Scripting Engineer, Peter Kahrel, explains.

Charts in Adobe InDesign are usually produced as separate files and placed in an InDesign document as images. These charts can be high-quality PDF or EPS files, but more often than not they are medium- to low-quality bitmaps.
Abstract image of overlaid bar charts and line graphs.

Many charts are also repetitive. For example, a financial data sheet that’s published every day or every week can contain one or more charts that are always the same apart from the height of bars (in a bar chart) or the way a line is drawn (in a line chart).

Title page of of the JavaScript for InDesign Book Excerpt in the April 2020 issue of InDesign Magazine. There is a short block of text, a photo of Peter Kahrel, and a shot of the book cover.

Book excerpt: JavaScript for InDesign

There are many repetitive and labour-intensive Adobe InDesign tasks that can be solved with scripting.

If you want to learn how to access Adobe InDesign’s hidden scripting riches, Peter Kahrel’s book JavaScript for InDesign is a great place to start!

Thanks to the team at InDesign Secrets, you can now download an excerpt which first appeared in the April 2020 edition of InDesign Magazine.

Title page of of the JavaScript for InDesign Book Excerpt in the April 2020 issue of InDesign Magazine. There is a short block of text, a photo of Peter Kahrel, and a shot of the book cover.

The excerpt also includes an exclusive set of simple one-liner scripts that Peter came up with to give you a quick taste of success!

Cover image for 'A typsetting treasure trove' blog post

A typesetting treasure trove

At first glance, it may not look like much—but Peter Kahrel’s extensive online repository of free scripts is an essential resource for anyone who works on long documents in InDesign.

Lines of JavaScript code overlaid on a photo of a laptop with a glowing gold light coming from the screen.
An online goldmine.

After hosting the script repository on his own website for many years, its future was in doubt late last year when Peter made the decision to relocate from the UK to Spain. His UK ISP refused to let him keep the site, or even set up redirection links.

Fortunately, David Blatner at CreativePro Network came to the rescue, and the repository now has a new home at CreativePro.com.

In this interview, Peter shares insights into the repository’s history, and some of the ways that InDesign typesetters can use his free scripts to make their lives easier.

Formatting the unformattable in InDesign

Peter Kahrel
Scripting Engineer, Typefi

In a Typefi workflow, if you want some text to automatically appear in a certain format in InDesign, you can apply that formatting as a local override or with a character style in your Word document, or encode it in an XML file.

This method of text formatting can’t be used in Typefi fields, because the composition engine doesn’t see that content. Typefi field content can contain only plain text: no formatting is possible.

However, this limitation can be overcome by including some rudimentary, HTML-like text tags in the field content and one or more GREP styles in the InDesign paragraph styles applied to the fields.