Miscellaneous InDesign scripting tips & tricks

Here I am going to collect some interesting stuff I find on scripting forums.

Alphabetical Sort in JavaScript (and InDesign)

Array

Background tasks

BridgeTalk

Clipboard

Color & swatch

Convert an image file to Base64

doScript

evaluateXPathExpression vs XML-rules: which is better?

everyItem().getElements()

Excel — How to get data directly from Excel

File - Folder

Font

GREP

Hyphen

Kerning

Measurement Units

Script UI

Smart Text Reflow

Socket

Table

Transforming page items

Version of an InDesign file

Versions of InDesign

Web

XML

Performance issues and good scripting practices

ExtendScript Toolkit Unbearably Slow? by Kriss Coppiters — explains why you shouldn´t abuse global variables.

“Writing code like a story” by Kriss Coppiters

Performance Optimizations for High Speed JavaScript

Performance tips

How to ... ?

How to set many properties at once

How to convert textframe to button

How to get contents string from itemByRange

How to get the Physical Length of a Piece of Text (in mm etc.)

See also ExtendScript Toolkit (ESTK) Tips