IdExtenso provides a new ArrayAs2D
module that unleashes the hidden strengths of ExtendScript operators. With this toy, you can now write code that adds, multiplies, evaluates 2D points or vectors. For example, if you develop an InDesign script based on Bézier curves or working on polygonal paths, all calculations of points, distances, normalized vectors, etc. become wonderfully compact…
Tag : Operators
Let's Play with JS Array Objects (in ExtendScript)
September 14, 2024 | Tips | en | fr
Make `&` (almost) Behave as a Reference Operator
August 09, 2024 | Tips | en
Suppose you have an ExtendScript class (I mean, “prototype”) whose methods essentially return new object instances. As an obvious example, consider the concat
or slice
methods of Array.prototype
. They always produce a new array rather than reworking the existing one. There are situations where you want to update the calling object —and make this explicit in the code— while still leveraging the methods already available…
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…
Operator Overloading with ExtendScript
May 25, 2010 | Tips | en
Operator overloading in JavaScript is a controversial issue. Actually, this dangerous feature has been rejected in ECMAScript 4. However, ExtendScript allows you to override the behavior of many mathematical and logical operators on a class-by-class basis since CS2.