Skip to content

InsertionPoints

app.activeDocument.textFrames[index].insertionPoints

A collection of InsertionPoint objects.


app.activeDocument.textFrames[index].insertionPoints.length

Number of elements in the collection.

Number; read-only.


app.activeDocument.textFrames[index].insertionPoints.parent

The object’s container.

Object; read-only.


app.activeDocument.textFrames[index].insertionPoints.typename

The class name of the object.

String; read-only.


app.activeDocument.textFrames[index].insertionPoints.index(itemKey)

Gets an element from the collection.

ParameterTypeDescription
itemKeyString, NumberString or number key

InsertionPoint


// Creates a new document, adds text then inserts a
// space between each character using insertion points
var docRef = documents.add();
var textRef = docRef.textFrames.add();
textRef.contents = "Wouldn't you rather be scripting?";
textRef.top = 400;
textRef.left = 100;
textRef.textRange.characterAttributes.size = 20;
redraw();
// Add a space between each character using insertion points.
var ip;
for (var i = 0; i < textRef.insertionPoints.length; i += 2) {
ip = textRef.insertionPoints[i];
ip.characters.add(" ");
}