Miscellaneous InDesign scripting tips & tricks

Here I am going to collect some interesting stuff (sorted by alphabet) I find on scripting forums.

Alphabetical Sort in JavaScript (and InDesign)

Array

Assignment

Background tasks

BridgeTalk

Bugs

bat-files (executing with/without the arguments)

Clipboard

Color & swatch

Convert an image file to Base64

Damaged documents (apps, scripts and tips for recovering)

doScript

evaluateXPathExpression vs XML-rules: which is better?

everyItem().getElements()

Excel — How to get data directly from Excel

File - Folder

Font

Frame — can contain more than one object at a time

Glue code loading

GREP

Hyphen

#include, #includepath (load library)

Kerning

Locale independent strings

Measurement Units

Menu item

Object hierarchy

Python

Script UI

Shell scripts (running from JS)

Smart Text Reflow

Socket

Table

Text frame

Transforming page items

Version of an InDesign file

Versions of InDesign application

Visual Basic

Web

XML

InDesign code samples

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