Posts in Category "Scripting"

HTML Extensibility in InDesign CC

The InDesign update you received in August 2013 (InDesign 9.1) included the enabling of HTML5 extensions.

As you may already know, starting in the middle of 2014 Adobe will begin removing Flash-based extension support in Creative Cloud products, starting with Photoshop CC.

If you have any hybrid or regular Flash extensions for InDesign you need to begin migrating them to HTML5 as soon as possible.

Continue reading…

Changing UI preferences in Javascript

A new feature in InDesign CC is the Dark UI. You can now adjust UI brightness and other UI properties using scripting.

  • matchPreviewBackgroundToThemeColor: If set to true the Preview Background color will be set to match the Theme Color
  • pasteboardColorPreference: Lets you set Pasteboard Color preference. Use 0 to set pasteboard color preference to Default White, and 1 to set preference to Match with Theme Color.
  • uiBrightnessPreference: Lets you specify the Application User Interface brightness preference (from 0.0 to 1.0). To use color theme brightness preset values, specify 0.0 for Dark, 0.33 for Medium Dark, 0.67 for Medium Bright, and 1.0 for Bright. Any value between 0.0 and 1.0 can also be used.

Here is an example in JavaScript:

Continue reading…

Creating QR Codes in JavaScript

A new feature in InDesign CC is the ability to create and place QR codes. Here, I show how to do this using JavaScript.

The following APIs are available:

  • createHyperlinkQRCode: for creating a QR code for a hyperlink).
  • createEmailQRCode: for creating a QR code for an email address.
  • createPlainTextQRCode: for creating a QR code for arbritary text.
  • createTextMsgQRCode: for creating a QR code for an SMS message.
  • createVCardQRCode: for creating a QR code for a vcard.

Here’s a nice easy sample:

Continue reading…

Running a script from an InDesign plug-in

Perhaps you’ve come to native plug-in development from a more script-based background, or perhaps you have some existing script code you want to reuse in a new plug-in project. Whatever your background, it’s really handy to be able to run a script from a native plug-in, and it’s also surprisingly easy.

The code below works out of the box so you can copy and paste as much as you please.

The above code uses JavaScript but you may use any script manager you like, including kAppleScriptMgrBoss for AppleScript and kOLEAutomationMgrBoss for Visual Basic. For a complete list of available scripting managers see ‘Script managers’ in chapter 10 ‘Scriptable Plug-in Fundamentals’ of the Programming Guide Volume 1 included in the plug-in SDK (available at

Scripting InDesign CS4 Preflight

We’ve received numerous requests for sample scripts that demonstrate working with the Adobe InDesign CS4 new live preflight feature. Several of these requests have come from InDesign Server partners who want to know how to use the new preflight engine. My Creative Suite Developer Technologies teammate Joe Stinson and I collaborated on the following information that we think will save you a lot of time when trying to script the new preflight feature.

If you are not familiar with preflight, please first watch this introductory video:

This post will demonstrate how to interact with the preflight system using JavaScript. For illustration purposes, we show how to configure preflight to raise an error if the page size is something other than letter size (8.5”X 11”). We briefly highlight how it’s done in the UI, then show how to achieve the same results through scripting.

Continue reading…