Miscellaneous scripting tips & tricks
Here I am going to collect some interesting stuff (sorted by alphabet) I find on scripting forums.
ActiveX Component — “Cannot create ActiveX Component” error message (on Windows only)
Bugs (see also non-scripting bugs)
bat-files (executing with/without the arguments)
Command line — passing arguments to the jsx file from command line
Conditional text
Convert an image file to Base64
Damaged documents (apps, scripts and tips for recovering)
Data Merge — Export to PDF using Data Merge
Dialog (InDesign's built-in class)
Dialog boxes — see Scrip UI
dll — an example of creating external library
evaluateXPathExpression vs XML-rules: which is better?
External library — an example of creating dll file
Frame — can contain more than one object at a time
Function — How to find function name from inside of itself
Glue code loading
Gradient
HTML — see Web
#include, #includepath (load library)
Page numbers
How to make page numbers appear in the column?
PageRange tester — Parse, format and normalize page ranges.
Path
inexutils — InDesign plugin to ignore missing plugins information from documents (by Manan-Joshi)
Polygon — How to calculate the total coverage of an irregular polygon shape in InDesign
Random — place circles at random locations
Shape
Shell scripts (running from JS)
TextStyleRange
Transformations
Unavailable to scripting features in InDesign
URL
Liberal Regex Pattern for All URLs
An Improved Liberal, Accurate Regex Pattern for Matching URLs
Unified eXtensibility Platform (UXP)
Varnish — add varnish script
Versions of InDesign application
Visual Basic (VBS, VBA)
While Loop — While Loop with Array.pop() Gotcha