is now part of CreativePro.com!

Book Excerpt: JavaScript for InDesign

7
InDesign Magazine Issue 132: After EffectsThis article appeared in Issue 132 of InDesign Magazine.

Don’t wait for Adobe to create the features you want in InDesign—make them yourself by learning JavaScript.

Anyone who works regularly in InDesign has compiled a wish list of features they’d like to see added to the program. But perhaps the greatest feature of them all already exists—the ability to control InDesign with scripts. That means you—yes, you!—can create the features you want. But first you need to learn how to tell InDesign what you want in a language that it understands, like Java­Script. And the best way to learn it for the purpose of writing InDesign scripts is to read Peter Kahrel’s book, JavaScript for InDesign. In the following pages, we present an excerpt to get you started, along with an exclusive set of simple one-liner scripts that Peter came up with to give you a quick taste of success.


. . . .

This article is for members only. To continue reading, please sign in, or sign up for a membership today. Thanks for supporting CreativePro!

BECOME A MEMBER

CreativePro membership keeps you up-to-date with the technology, solutions, and resources to strengthen your professional development.

For just $6.50/month (billed annually), you’ll get access to valuable benefits, including:

  • 12 monthly issues of CreativePro Magazine, filled with practical, real-world tutorials written by experts
  • Downloadable resources including templates, fonts, scripts, design assets, cheat sheets, and more
  • Hundreds of members-only tutorial and tip articles
  • Top Tips for InDesign, Photoshop, and Illustrator ebook collection
  • Discounts on events and books
  • and more...

Sign up now!


Peter Kahrel is the author of several eBooks on InDesign and scripting, including GREP in InDesign, published by CreativePro Network. He also wrote the feature article on "Getting a Grip on GREP" in InDesign Magazine Issue 59.
  • Is there a script that will check endnotes and match them to Chicago style?

  • Peter Kahrel says:

    There might be, but it won’t be a one-liner, which is what the article is about.

  • only curious if it is possible. can i have a script run automatically after a user double clicks a page in the pages panel? i simply want to have the “fit spread in window” menu item evoked after the mouse double clicks a page.
    cheers,
    mark

    • Peter Kahrel says:

      A script can’t do that, that would require a plug-in. You could press Ctrl+Alt+0 (or its Mac equivalent). If the function wasn’t set as a shortcut, you can define a key combination to set the view.

  • karien says:

    Hi Peter,
    I’m a fan of your scripts! But the thing I miss the most in Indesign is a sort of Time Tracker. I paid for the Open Hour-version, bur unfortunately they stopped their support. Is it possible to make a script that registers AUTOMATICALLY when you work in Indesign without having to switch it on and off. I keep forgetting that, so the Paymo Time Tracker isn’t ideal for me…

  • Peter Kahrel says:

    Hi Karien. It looks as if it’s possible for an InDesign script to detect when the app becomes active and when it’s quit. You’d better head over to the scripting forum (https://indesignsecrets.com/forum/indesign-add-ons-scripts-scripting-and-plug-ins) or to Adobe’s Scripting forum (https://community.adobe.com/t5/forums/filteredbylabelpage/board-id/indesign/label-name/scripting). The latter is probably better for what you’re after. There are several good script writers there who can do your script (for a fee).
    P.

  • Cristian Ronban says:

    I would love to buy the book, but I’m afraid of your shop partner asking for private data and forcing you to accept giving them away in order to buy it…

  • >