In most cases, ExtendScript regular expressions cannot digest the (a|b)+
scheme. This bug is not new, but it's worth defining its symptoms and extent. This article presents a very simple problem, with no known solution to date…
Tag : ExtendScript
The Hard Problem of Quantified Alternatives in ExtendScript
January 21, 2022 | Tips | en
Porting your InDesign Script into IdExtenso — Step 5
October 19, 2021 | Tips | en
In this episode we seriously improve the relationship between user settings and user interface. As a result, we get a smart InDesign script that both remembers the choices the user made within the session and adapts to the context, that is, whether the script should target the selection or a larger scope…
Porting your InDesign Script into IdExtenso — Step 4
October 09, 2021 | Tips | en
The previous episode dealt with modularity in IdExtenso, now is the time to take full advantage of it! Today we will see how to add a dialog interacting with user options. You will be amazed at how quickly this component fits into the script…
Porting your InDesign Script into IdExtenso — Step 3
September 24, 2021 | Tips | en
In this episode, you will learn how to arrange your code so that it fits into IdExtenso's “modular space.” Modularity is a key term when it comes to maintaining a large-scale project. Even if our sample script is not in itself of pharaonic complexity, we will transform it, as an exercise, into a pure module…
Porting your InDesign Script into IdExtenso — Step 2
September 15, 2021 | Tips | en
Today we will embed in IdExtenso the code we prepared in the previous episode. That's of course an important move, especially when you perform it for the very first time (since then you need to install the framework.) But you will discover in what follows the immediate advantages that $$ offers you…
Porting your InDesign Script into IdExtenso — Step 1
September 07, 2021 | Tips | en
So, you have the root idea and a basic code for your next InDesign script. All is fine. It works so well that you're now planning to release it, which opens additional questions: Will it work everywhere? How do I trace risky functions? What if I need to integrate new features later on? How do I deal with persistent user settings? How to add a basic interface? How will I localize the dialog in other languages? Can I make my script available in a dedicated menu? Will it work in a JSXBIN package as well? Can I obfuscate my code?…
Page Range Formatter [UPDATE]
August 17, 2021 | Tips | en
Given an unordered set of page numbers—e.g. {13, 9, 25, 12, 11, 8}
—we often have to compute and output a range specification in the form "8-9; 11-13; 25"
. While this topic has been already discussed in the InDesign scripting forum, I'd like to explore today a slightly different approach…
Drawing Sine Waves in InDesign [UPDATE]
March 21, 2021 | Snippets | en | fr
Computing Bézier curves that really look like sine waves is an exciting challenge for script developers. One needs to deal with both optimizing control points, transforming coordinate spaces and splitting curves. Here is a function that solves it all in ExtendScript for InDesign…
Understanding the `count( )` Method
November 13, 2020 | Tips | en
InDesign's scripting infrastructure is based on DOM objects (Document
, Story
, Paragraph
…) and any such object has an associated collection (Documents
, Stories
, Paragraphs
…). Collections typically arise in complex specifiers like myDocument.stories.everyItem().words
. They also provide two essential members, the length
property and the count()
method. How do they differ?
The Tricky Side of `string.replace( )` in ExtendScript
September 14, 2020 | Tips | en
When you invoke myString.replace(...)
in pure JavaScript, the “string being examined” is and remains myString during the whole operation. ExtendScript offers a slightly different mechanism that may unexpectedly alter the output string…
Why You Should Never Use `x==null` in ExtendScript
May 13, 2020 | Tips | en
The Japanese scripter あるふぁ found a bug affecting any ExtendScript code based on ...==null
. This is not a critical issue (because experienced developers never use such condition!) but the case provides the opportunity to summarize important rules regarding falsey values and the equality operator…
InDesign Scripting Forum Roundup #13
June 06, 2019 | Snippets | en
Here are nine useful InDesign scripts extracted from one year of debate in the scripting branch of forums.adobe.com. There are snippets for every taste—text, layout, graphics, geometry, UI—so take a look!
PhysicalSize | Check Your Design At True 1:1 Magnification
February 08, 2019 | PhysicalSize | en | fr
Every InDesign user must accept this boring fact: “100% size preview is not actual size”. Because of this old unsolved flaw, graphic designers, layout artists, typographers… cannot trust the so-called “Actual Size” command. With PhysicalSize you will be able to recover your sight…
JsxBlind | The Case of “Nested” Variable Names
February 06, 2019 | JsxBlind | en
While version 2.1 of JsxBlind library has just been released, I'd like to focus on a technical issue you may have encountered. If the script to be obfuscated contains eval(…) or app.doScript(…) blocks, there is a good chance that abysmal errors arise. Here is the solution to this enigma…
How To Get parseInt( ) Fixed in ExtendScript
January 10, 2019 | Tips | en
The global method parseInt(str,radix)
has a critical bug in ExtendScript. When radix
is greater than 10, some undesired characters can be mistakenly parsed as valid digits, which corrupts the output. This issue is solved in IdExtenso…
Note on ScriptUI Mouse Events
December 19, 2018 | Tips | en
ScriptUI provides a set of usual mouse events (mouseover
, mousedown
, mouseup
, click
…) which are of primary interest in responsive user interfaces (UI). Developers can add event listeners to any UI component that needs to respond accordingly when the mouse enters the scene. But handling such events requires carefulness if your script has to support both CS and CC environments.
JsxBlind 2.0 Meets IdExtenso
October 31, 2018 | JsxBlind | en
Faster, cleaner, smarter, JsxBlind 2.001 is out! As a library, it now belongs to IdExtenso's toolbox, which I think is top-notch news for serious ExtendScript developers. Also available here is the “standalone version” (named JsxBlindRun
) that should work fine from InDesign CS4-CC or ESTK…
InDesign Scripting Forum Roundup #12
June 11, 2018 | Snippets | en
Hey scripters, are you familiar with InDesign events, event listeners, menu actions, idle tasks? That's the hot focus of the 12th ISFR. Plus a fine selection of threads and snippets involving GREP, text, CMYK swatches, IDML, transformations… Enjoy the ride!
« previous entries - Page 1 of 3