Skip to content

TextFrameItem

app.activeDocument.textFrames[index]

The basic art item for displaying text. From the user interface, this is text created with the Text tool. There are three types of text art in Illustrator: point text, path text, and area text. The type is indicated by the text frame’s kind property.

When you create a text frame, you also create a Story object. However, threading text frames combines the frames into a single story object. To thread frames, use the nextFrame or previousFrame property.


app.activeDocument.textFrames[index].anchor

The position of the anchor point, the start of the base line for point text.

Array of 2 numbers


app.activeDocument.textFrames[index].antialias

The type of anti-aliasing to use in the text.

TextAntialias


app.activeDocument.textFrames[index].characters

All the characters in this text frame.

Characters; read-only.


app.activeDocument.textFrames[index].columnCount

The column count in the text frame (area text only).

Number (long)


app.activeDocument.textFrames[index].columnGutter

The column gutter in the text frame (area text only).

Number (double)


app.activeDocument.textFrames[index].contents

The text string.

String


app.activeDocument.textFrames[index].contentVariable

The content variable bound to this text frame item.

Variable


app.activeDocument.textFrames[index].endTValue

The end position of text along a path, as a value relative to the path’s segments (path text only).

Number (double)


app.activeDocument.textFrames[index].flowLinksHorizontally

If true, flow text between linked frames horizontally first (area text only).

Boolean


app.activeDocument.textFrames[index].insertionPoints

All the insertion points in this text range.

InsertionPoints; read-only.


app.activeDocument.textFrames[index].kind

The type of a text frame item (area, path or point).

TextType; read-only.


app.activeDocument.textFrames[index].lines

All the lines in this text frame.

Lines; read-only.


app.activeDocument.textFrames[index].matrix

The transformation matrix for this text frame.

Matrix; read-only.


app.activeDocument.textFrames[index].nextFrame

The linked text frame following this one.

TextFrameItem


app.activeDocument.textFrames[index].opticalAlignment

If true, the optical alignment feature is active.

Boolean


app.activeDocument.textFrames[index].orientation

The orientation of the text.

TextOrientation


app.activeDocument.textFrames[index].paragraphs

All the paragraphs in this text frame.

Paragraphs; read-only.


app.activeDocument.textFrames[index].parent

The parent of this object.

Layer or GroupItem; read-only.


app.activeDocument.textFrames[index].previousFrame

The linked text frame preceding this one.

TextFrameItem


app.activeDocument.textFrames[index].rowCount

The row count in the text frame (area text only).

Number (long)


app.activeDocument.textFrames[index].rowGutter

The row gutter in the text frame (area text only).

Number (double)


app.activeDocument.textFrames[index].spacing

The amount of spacing.

Number (double)


app.activeDocument.textFrames[index].startTValue

The start position of text along a path, as a value relative to the path’s segments (path text only).

Number (double)


app.activeDocument.textFrames[index].story

The story to which the text frame belongs.

Story; read-only.


app.activeDocument.textFrames[index].textPath

The path item associated with the text frame. Note: Valid only when kind is area or path.

TextPath


app.activeDocument.textFrames[index].textRange

The text range of the text frame.

TextRange; read-only.


app.activeDocument.textFrames[index].textRanges

All the text in this text frame.

TextRanges; read-only.


app.activeDocument.textFrames[index].textSelection

The selected text range(s) in the text frame.

Array of TextRange; read-only.


app.activeDocument.textFrames[index].typename

The class name of the referenced object.

String; read-only.


app.activeDocument.textFrames[index].words

All the words in this text frame.

Words; read-only.


TextFrameItem.convertAreaObjectToPointObject()

Section titled “TextFrameItem.convertAreaObjectToPointObject()”

app.activeDocument.textFrames[index].convertAreaObjectToPointObject()

Converts the area-type text frame to a point-type text frame.

TextFrameItem


TextFrameItem.convertPointObjectToAreaObject()

Section titled “TextFrameItem.convertPointObjectToAreaObject()”

app.activeDocument.textFrames[index].convertPointObjectToAreaObject()

Converts the point-type text frame to an area-type text frame.

TextFrameItem


app.activeDocument.textFrames[index].createOutline()

Converts the text in the text frame to outlines.

GroupItem


app.activeDocument.textFrames[index].duplicate([relativeObject] [,insertionLocation])

Creates a duplicate of the selected object.

ParameterTypeDescription
relativeObjectObject, optionalObject to duplicate to
insertionLocationElementPlacement, optionalLocation to insert element

TextRange


app.activeDocument.textFrames[index].move(relativeObject, insertionLocation)

Moves the object.

ParameterTypeDescription
relativeObjectObjectObject to move element within
insertionLocationElementPlacement, optionalLocation to move element to

TextRange


app.activeDocument.textFrames[index].remove()

Deletes this object.

Nothing.


app.activeDocument.textFrames[index].resize(
scaleX,
scaleY
[,changePositions]
[,changeFillPatterns]
[,changeFillGradients]
[,changeStrokePattern]
[,changeLineWidths]
[,scaleAbout]
)

Scales the art item where scaleX is the horizontal scaling factor and scaleY is the vertical scaling factor. 100.0 = 100%.

ParameterTypeDescription
scaleXNumber (double)Horizontal scaling factor
scaleYNumber (double)Vertical scaling factor
changePositionsBoolean, optionalWhether to effect art object positions and orientations
changeFillPatternsBoolean, optionalWhether to transform fill patterns
changeFillGradientsBoolean, optionalWhether to transform fill gradients
changeStrokePatternBoolean, optionalWhether to transform stroke patterns
changeLineWidthsNumber (double), optionalThe amount to scale line widths
scaleAboutTransformation, optionalThe point to use as anchor, to transform about

Nothing.


app.activeDocument.textFrames[index].rotate(
angle
[,changePositions]
[,changeFillPatterns]
[,changeFillGradients]
[,changeStrokePattern]
[,rotateAbout]
)

Rotates the art item relative to the current rotation. The object is rotated counter-clockwise if the angle value is positive, clockwise if the value is negative.

ParameterTypeDescription
angleNumber (double)The angle amount to rotate the element
changePositionsBoolean, optionalWhether to effect art object positions and orientations
changeFillPatternsBoolean, optionalWhether to transform fill patterns
changeFillGradientsBoolean, optionalWhether to transform fill gradients
changeStrokePatternBoolean, optionalWhether to transform stroke patterns
rotateAboutTransformation, optionalThe point to use as anchor, to transform about

Nothing.


app.activeDocument.textFrames[index].transform(
transformationMatrix
[, changePositions]
[, changeFillPatterns]
[, changeFillGradients]
[, changeStrokePattern]
[, changeLineWidths]
[, transformAbout]
)

Transforms the art item by applying a transformation matrix.

ParameterTypeDescription
transformationMatrixMatrixTransformation matrix to apply
changePositionsBoolean, optionalWhether to change Positions
changeFillPatternsBoolean, optionalWhether to change Fill Patterns
changeFillGradientsBoolean, optionalWhether to change Fill Gradients
changeStrokePatternBoolean, optionalWhether to change Stroke Pattern
changeLineWidthsNumber (double), optionalThe amount to scale line widths
transformAboutTransformation, optionalThe point to use as anchor, to transform about

Nothing.


app.activeDocument.textFrames[index].translate(
[deltaX]
[, deltaY]
[, transformObjects]
[, transformFillPatterns]
[, transformFillGradients]
[, transformStrokePatterns]
)

Repositions the art item relative to the current position, where deltaX is the horizontal offset and deltaY is the vertical offset.

ParameterTypeDescription
deltaXNumber (double), optionalHorizontal offset
deltaYNumber (double), optionalVertical offset
transformObjectsBoolean, optionalWhether to transform Objects
transformFillPatternsBoolean, optionalWhether to transform Fill Patterns
transformFillGradientsBoolean, optionalWhether to transform Fill Gradients
transformStrokePatternsBoolean, optionalWhether to transform Stroke Patterns

Nothing.


app.activeDocument.textFrames[index].zOrder(zOrderCmd)

Arranges the art item’s position in the stacking order of the group or layer (parent) of this object.

ParameterTypeDescription
zOrderCmdZOrderMethodStacking order arrangement method

Nothing.


// Duplicates and rotates the selected text art item 5 times
if ( app.documents.length > 0 ) {
selectedItems = app.activeDocument.selection;
// make sure something is selected.
if ( selectedItems.length > 0 ) {
// The selection must be a text art item
if ( selectedItems[0].typename == "TextFrame" ) {
// Get the parent of the text art so new text art items
// can be inserted in the same group or layer
dupSrc = selectedItems[0];
textContainer = dupSrc.parent;
// Create 5 new versions of the text art each rotated a bit
for ( i = 1; i <= 5; i++ ) {
dupText = dupSrc.duplicate( textContainer, ElementPlacement.PLACEATEND );
dupText.rotate(180 * i/6);
}
}
}
}