跳转到内容

插入点

app.activeDocument.textFrames[index].insertionPoints

InsertionPoint 对象的集合。


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

集合中的元素数量。

数字;只读。


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

对象的容器。

对象;只读。


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

对象的类名。

字符串;只读。


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

从集合中获取一个元素。

参数类型描述
itemKey字符串, 数字字符串或数字键

InsertionPoint


// 创建一个新文档,添加文本,然后使用插入点在每个字符之间插入空格
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();
// 使用插入点在每个字符之间添加空格。
var ip;
for (var i = 0; i < textRef.insertionPoints.length; i += 2) {
ip = textRef.insertionPoints[i];
ip.characters.add(" ");
}