Indiscripts

Automating InDesign since 2009

Tag : JavaScript

InDesign Scripting Forum Roundup #8

Summer is the ideal time to deepen your knowledge of InDesign scripting, isn't it? In this new episode of our roundup series we will investigate Page objects, style groups, and a nice selection of practical snippets. Feel free to grab and share the good stuff…

Continue reading...

Reconsidering Array.sort( ) in ExtendScript/JavaScript — Part 2

In my previous post I introduced some key concepts and tools for benchmarking Array.sort() and took you through the “standard model” of optimizing the callback function. We also emphasized that, of course, it is impossible to go faster than the native method. If these clues made you sit up and take notice, it's time to go one step further…

Continue reading...

Reconsidering Array.sort( ) in ExtendScript/JavaScript — Part 1

The pattern array.sort(compareFunc) is widely used by JavaScript programmers when elements being sorted are not supposed to represent basic strings in the sense of UTF16 ordered character sequences. In particular, sorting numbers forces you to provide that stupid custom compareNumbers routine which, in most cases, just looks like function(x,y){return x-y}. And even when you have to sort actual strings, there are countless situations where the default Unicode code point order is inappropriate. But a question arises: what is the performance cost of using a non-native comparison routine?

Continue reading...

InDesign Scripting Forum Roundup #7

Do you want to stretch your InDesign-scripting power? Check out the new episode of the ISFR series and improve your skills in managing text, characters, styles, page items, events… in an automated manner.

Continue reading...

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...

- Page 2 of 3 -