Indiscripts

Automating InDesign since 2009

Tag : JavaScript

InDesign Scripting Forum Roundup #6

Just by chance, the new episode of our ISFR series focuses on two topics often considered the most complex in InDesign scripting: page coordinates on the one hand, tables and cells on the other. Here are some enlightening discussions in these areas…

Continue reading...

ExtendScript Core Entities Diagram

Exploring the prototypal relationships between basic ExtendScript's entities reveals an interesting network of hidden objects. The following diagram shows that ExtendScript's own implementation of JavaScript is deeply connected with a root function (referred to as [[Function]] in the figure) which provides the actual prototype—that is, the __proto__ property—of many visible objects, including Function and Object themselves…

Continue reading...

InDesign Scripting Forum Roundup #5

As pointed out by Davide Barranca in his recent Open Letter to (Adobe) Devs scripting resources appear very sparse on the Internet. At some level, this ISFR series is an attempt to keep interesting codes, snippets, and knowledge visible to InDesign scripters, from various discussions I have participated in during the last months. Let's get to the heart of the matter…

Continue reading...

So What's New in InDesign CC Scripting DOM

Considering the size of the PDF, below, you could think that InDesign CC offers plenty of new features. But that's just an optical illusion! In fact, the vast majority of members introduced into the Scripting DOM regard QR Code's API, which is based on the recurring methods createEmailQRCode(), createHyperlinkQRCode(), createPlainTextQRCode(), createTextMsgQRCode(), and createVCardQRCode().

Apart from that a very small number of innovations is identifiable in the scripting area of InDesign CC—most are relative to look-and-feel and EPUB Export options. What is not highlighted here, however, is the fact that many ScriptUI features are now broken, or partially locked. The new InDesign skin subsystem introduces drastic limitations in the way scripters can customize oldschool user interfaces. For example, ScriptUI fonts do not seem to be supported anymore, and many event types or listeners (focus, onDraw…) are quite defective for various widgets. Also, FlashPlayer embedding leads to critical issues—as it has been reported that invokePlayerFunction() just does not work anymore. In short: very bad news for InDesign developers!

Download “What's New in InDesign CC Scripting” (PDF)

• See also:
“So What's New in InDesign CS6 Scripting DOM”
“So What's New in InDesign CS5.5 Scripting DOM”
“So What's New in InDesign CS5 Scripting DOM”

InDesign Scripting Forum Roundup #4

Welcome in the new episode of the Scripting Forum Roundup series. Today I decided to focus on solid tricks and in-depth topics that might be of interest to experienced script developers…

Continue reading...

Meet Loïc Aigon, Automation Expert!

My colleague Loïc Aigon recently updated his professional website: loicaigon.com. I take this opportunity to let him unveil axis and motions of a misknown job: automation expert

Loïc's Home Page / Design: Doopix.fr

Continue reading...

Making String.split() support U+0000 in ExtendScript CS4

For obscure reasons ExtendScript 3.x is somewhat allergic to the character "\x00" (U+0000). Some String and RegExp routines become silently defective as soon as your source string contains one or more NUL character. Although most of these bugs have been fixed in CS5 (ExtendScript 4.1), this still leads to compatibility and portability issues. Here is a snippet that allows to split any string and get proper results in all versions.

Continue reading...

140+ InDesign and Creative Tasks            You Didn't Know You Could Automate

140+ InDesign and Creative Tasks -- Top 2012 ReTweetsNew tools, new solutions, new ideas, emerge every day for and from InDesign and Creative Suite heroes. But strangely enough, most graphic designers and InDesign end-users still ignore—or cannot measure—the power of automation. As a kind of proof of concept I decided to start the year with a celebration of the most noticeable scripts, tools and resources that have shaken 2012 in this area. Since I use Twitter as a bookmarking platform, it seemed fun to compile a selection of links I've tweeted or re-tweeted during the last 12 months. This is also an opportunity to pay tribute to my colleagues, scripters, developers, trainers, and time-savers! Now make yourself comfortable and enter in the Productive Dome…

Continue reading...

Space Invaders Game in InDesign!

Layout Invaders for InDesign CS5/CS6, script created by Philipp Geuder.

Continue reading...

How to Augment and Process Nested Groups (CS4-CS6)

Dealing with groups is a major headache for InDesign scripters. On one hand, the Group object has no injection method to offer, which makes difficult to append existing page items into a given group. On the other hand, although the Groups API exposes a promising add() method, nobody has ever managed to use this feature from any PageItem.groups area, so we seem doomed to perpetually rebuild groups from scratch.

Continue reading...

InDesign Scripting Forum Roundup #3

Here is the third episode of the Scripting Forum Roundup(s), a selection of 18 recommended discussions and sample codes which I have contributed to over the last six months. Enjoy!

Continue reading...

So What's New in InDesign CS6 Scripting DOM

InDesign CS6 is full of new features, which explains the size (98 pages) of the Object Members part in our tracking-change PDF below. Of course many additions regard interactivity, form behaviors and the related events. The Scripting DOM now includes the following ubiquitous collections: checkBoxes, comboBoxes, listBoxes, radioButtons, signatureFields, textBoxes. A number of existing objects have been extended accordingly.

Besides, there are many interesting additions to discover and experiment. Have fun!

Download “What's New in InDesign CS6 Scripting | Object Members” (PDF)

Download “What's New in InDesign CS6 Scripting | Enumerators” (PDF)

• See also:
“So What's New in InDesign CS5.5 Scripting DOM”
“So What's New in InDesign CS5 Scripting DOM”

InDesign Scripting Forum Roundup #2

As opened in the “InDesign Scripting Forum: 25 ‘sticky’ posts” article, I will regularly feed this section with recommended discussions and/or snippets which I have contributed to through the ID Scripting Forum. Here is the scripting stuff I found specially interesting over the last six months…

Continue reading...

Notes on ‘fastEntireScript’ Undo Mode

In April 2009, Thomas Silkjær reported a bug on app.doScript that alters the ‘undo’ feature in InDesign. Although this issue has been fixed in CS5, there are still some pitfalls to beware of when you want to speed up your script through fastEntireScript

Continue reading...

Comparing the Performance of ExtendScript Snippets

Although jsPerf is a very effective tool in a pure JavaScript environment, you may want to benchmark competing code snippets in the specific ExtendScript field. Here is a simple way to test and improve your InDesign scripted functions…

Continue reading...

Permutation d'objets dans InDesign (miniscript)

Non sans témérité, Stéphane Baril et David Deraedt nous ont récemment accueillis sur le plateau de Chips & Tips, la célèbre série d'Adobe TV dédiée à la diététique productivité. Au détour de cet épisode, Loïc Aigon et votre serviteur proposons une sorte de préambule aux techniques d'automatisation et de scripting dans la Creative Suite, avec quelques illustrations simples et directement accessibles aux néophytes. Vous y découvrirez notamment la version embryonnaire du script SwapItems utilisé pour permuter des objets dans une maquette InDesign…

Continue reading...

So What's New in InDesign CS5.5 Scripting DOM

The interesting thing about tracking Scripting DOM changes from InDesign CS5 to InDesign CS5.5 is that this instantly reveals the main innovations of this ‘mid-cycle’ release —so that scripters can easily focus on the freshest features. The below PDFs offer you in a snap the tip of the iceberg: the new Article component and a bunch of new export options (HTMLExportPreference, EPubExportPreference, StyleExportTagMap, ObjectExportOption) that indicate the much greater integration of InDesign EPUB and digital publishing capabilities. Enjoy!

Download “What's New in InDesign CS5.5 Scripting | Object Members” (PDF)

Download “What's New in InDesign CS5.5 Scripting | Enumerators” (PDF)

• See also: “So What's New in InDesign CS5 Scripting DOM”

InDesign Scripting Forum: 25 ‘sticky’ posts [roundup]

The InDesign Scripting Forum is an ideal place to post scripting recipes and to address technical issues. I learn a lot from its famous contributors —Dave Saunders, Harbs, Jongware, Peter Kahrel, Kasyan Servetsky, Marijan Tompa… At odd times I post my own brainchilds. Here is a small selection of snippets and topics that I think are worthwhile.

Continue reading...

Alphabetical Sort in JavaScript (and InDesign)

Surprisingly, JavaScript offers no easy way to alphabetize words in relevant order. Although the Array.sort() method is known to perform, by default, a lexicographical sort, you will find very quickly that the result is wrong in most real-life situations. Actually, the internal mechanism of JS sorting is confined to compare Unicode characters by their code points, so 'Z' (U+005A) comes before 'e' (U+0065), which itself comes before 'ç' (U+00E7), etc. Also, you have all noted with vexation that InDesign does not offer any alphabetical sort feature! Here is an experimental tool to help restore order in Latin alphabets.

Continue reading...

So What's New in InDesign CS5 Scripting DOM

Download “What's New in InDesign CS5 Scripting | Object Members” (PDF)

Download “What's New in InDesign CS5 Scripting | Enumerators” (PDF)

- Page 2 of 3 -