TextFrameItem
TextFrameItem
Section titled “TextFrameItem”app.activeDocument.textFrames[index]
Description
Section titled “Description”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.
Properties
Section titled “Properties”TextFrameItem.anchor
Section titled “TextFrameItem.anchor”app.activeDocument.textFrames[index].anchor
Description
Section titled “Description”The position of the anchor point, the start of the base line for point text.
Array of 2 numbers
TextFrameItem.antialias
Section titled “TextFrameItem.antialias”app.activeDocument.textFrames[index].antialias
Description
Section titled “Description”The type of anti-aliasing to use in the text.
TextFrameItem.characters
Section titled “TextFrameItem.characters”app.activeDocument.textFrames[index].characters
Description
Section titled “Description”All the characters in this text frame.
Characters; read-only.
TextFrameItem.columnCount
Section titled “TextFrameItem.columnCount”app.activeDocument.textFrames[index].columnCount
Description
Section titled “Description”The column count in the text frame (area text only).
Number (long)
TextFrameItem.columnGutter
Section titled “TextFrameItem.columnGutter”app.activeDocument.textFrames[index].columnGutter
Description
Section titled “Description”The column gutter in the text frame (area text only).
Number (double)
TextFrameItem.contents
Section titled “TextFrameItem.contents”app.activeDocument.textFrames[index].contents
Description
Section titled “Description”The text string.
String
TextFrameItem.contentVariable
Section titled “TextFrameItem.contentVariable”app.activeDocument.textFrames[index].contentVariable
Description
Section titled “Description”The content variable bound to this text frame item.
TextFrameItem.endTValue
Section titled “TextFrameItem.endTValue”app.activeDocument.textFrames[index].endTValue
Description
Section titled “Description”The end position of text along a path, as a value relative to the path’s segments (path text only).
Number (double)
TextFrameItem.flowLinksHorizontally
Section titled “TextFrameItem.flowLinksHorizontally”app.activeDocument.textFrames[index].flowLinksHorizontally
Description
Section titled “Description”If true
, flow text between linked frames horizontally first (area text only).
Boolean
TextFrameItem.insertionPoints
Section titled “TextFrameItem.insertionPoints”app.activeDocument.textFrames[index].insertionPoints
Description
Section titled “Description”All the insertion points in this text range.
InsertionPoints; read-only.
TextFrameItem.kind
Section titled “TextFrameItem.kind”app.activeDocument.textFrames[index].kind
Description
Section titled “Description”The type of a text frame item (area, path or point).
TextType; read-only.
TextFrameItem.lines
Section titled “TextFrameItem.lines”app.activeDocument.textFrames[index].lines
Description
Section titled “Description”All the lines in this text frame.
Lines; read-only.
TextFrameItem.matrix
Section titled “TextFrameItem.matrix”app.activeDocument.textFrames[index].matrix
Description
Section titled “Description”The transformation matrix for this text frame.
Matrix; read-only.
TextFrameItem.nextFrame
Section titled “TextFrameItem.nextFrame”app.activeDocument.textFrames[index].nextFrame
Description
Section titled “Description”The linked text frame following this one.
TextFrameItem.opticalAlignment
Section titled “TextFrameItem.opticalAlignment”app.activeDocument.textFrames[index].opticalAlignment
Description
Section titled “Description”If true
, the optical alignment feature is active.
Boolean
TextFrameItem.orientation
Section titled “TextFrameItem.orientation”app.activeDocument.textFrames[index].orientation
Description
Section titled “Description”The orientation of the text.
TextFrameItem.paragraphs
Section titled “TextFrameItem.paragraphs”app.activeDocument.textFrames[index].paragraphs
Description
Section titled “Description”All the paragraphs in this text frame.
Paragraphs; read-only.
TextFrameItem.parent
Section titled “TextFrameItem.parent”app.activeDocument.textFrames[index].parent
Description
Section titled “Description”The parent of this object.
Layer or GroupItem; read-only.
TextFrameItem.previousFrame
Section titled “TextFrameItem.previousFrame”app.activeDocument.textFrames[index].previousFrame
Description
Section titled “Description”The linked text frame preceding this one.
TextFrameItem.rowCount
Section titled “TextFrameItem.rowCount”app.activeDocument.textFrames[index].rowCount
Description
Section titled “Description”The row count in the text frame (area text only).
Number (long)
TextFrameItem.rowGutter
Section titled “TextFrameItem.rowGutter”app.activeDocument.textFrames[index].rowGutter
Description
Section titled “Description”The row gutter in the text frame (area text only).
Number (double)
TextFrameItem.spacing
Section titled “TextFrameItem.spacing”app.activeDocument.textFrames[index].spacing
Description
Section titled “Description”The amount of spacing.
Number (double)
TextFrameItem.startTValue
Section titled “TextFrameItem.startTValue”app.activeDocument.textFrames[index].startTValue
Description
Section titled “Description”The start position of text along a path, as a value relative to the path’s segments (path text only).
Number (double)
TextFrameItem.story
Section titled “TextFrameItem.story”app.activeDocument.textFrames[index].story
Description
Section titled “Description”The story to which the text frame belongs.
Story; read-only.
TextFrameItem.textPath
Section titled “TextFrameItem.textPath”app.activeDocument.textFrames[index].textPath
Description
Section titled “Description”The path item associated with the text frame. Note: Valid only when kind is area or path.
TextFrameItem.textRange
Section titled “TextFrameItem.textRange”app.activeDocument.textFrames[index].textRange
Description
Section titled “Description”The text range of the text frame.
TextRange; read-only.
TextFrameItem.textRanges
Section titled “TextFrameItem.textRanges”app.activeDocument.textFrames[index].textRanges
Description
Section titled “Description”All the text in this text frame.
TextRanges; read-only.
TextFrameItem.textSelection
Section titled “TextFrameItem.textSelection”app.activeDocument.textFrames[index].textSelection
Description
Section titled “Description”The selected text range(s) in the text frame.
Array of TextRange; read-only.
TextFrameItem.typename
Section titled “TextFrameItem.typename”app.activeDocument.textFrames[index].typename
Description
Section titled “Description”The class name of the referenced object.
String; read-only.
TextFrameItem.words
Section titled “TextFrameItem.words”app.activeDocument.textFrames[index].words
Description
Section titled “Description”All the words in this text frame.
Words; read-only.
Methods
Section titled “Methods”TextFrameItem.convertAreaObjectToPointObject()
Section titled “TextFrameItem.convertAreaObjectToPointObject()”app.activeDocument.textFrames[index].convertAreaObjectToPointObject()
Description
Section titled “Description”Converts the area-type text frame to a point-type text frame.
Returns
Section titled “Returns”TextFrameItem.convertPointObjectToAreaObject()
Section titled “TextFrameItem.convertPointObjectToAreaObject()”app.activeDocument.textFrames[index].convertPointObjectToAreaObject()
Description
Section titled “Description”Converts the point-type text frame to an area-type text frame.
Returns
Section titled “Returns”TextFrameItem.createOutline()
Section titled “TextFrameItem.createOutline()”app.activeDocument.textFrames[index].createOutline()
Description
Section titled “Description”Converts the text in the text frame to outlines.
Returns
Section titled “Returns”TextFrameItem.duplicate()
Section titled “TextFrameItem.duplicate()”app.activeDocument.textFrames[index].duplicate([relativeObject] [,insertionLocation])
Description
Section titled “Description”Creates a duplicate of the selected object.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
relativeObject | Object, optional | Object to duplicate to |
insertionLocation | ElementPlacement, optional | Location to insert element |
Returns
Section titled “Returns”TextFrameItem.move()
Section titled “TextFrameItem.move()”app.activeDocument.textFrames[index].move(relativeObject, insertionLocation)
Description
Section titled “Description”Moves the object.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
relativeObject | Object | Object to move element within |
insertionLocation | ElementPlacement, optional | Location to move element to |
Returns
Section titled “Returns”TextFrameItem.remove()
Section titled “TextFrameItem.remove()”app.activeDocument.textFrames[index].remove()
Description
Section titled “Description”Deletes this object.
Returns
Section titled “Returns”Nothing.
TextFrameItem.resize()
Section titled “TextFrameItem.resize()”app.activeDocument.textFrames[index].resize( scaleX, scaleY [,changePositions] [,changeFillPatterns] [,changeFillGradients] [,changeStrokePattern] [,changeLineWidths] [,scaleAbout])
Description
Section titled “Description”Scales the art item where scaleX
is the horizontal scaling factor and scaleY
is the vertical scaling factor. 100.0 = 100%.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
scaleX | Number (double) | Horizontal scaling factor |
scaleY | Number (double) | Vertical scaling factor |
changePositions | Boolean, optional | Whether to effect art object positions and orientations |
changeFillPatterns | Boolean, optional | Whether to transform fill patterns |
changeFillGradients | Boolean, optional | Whether to transform fill gradients |
changeStrokePattern | Boolean, optional | Whether to transform stroke patterns |
changeLineWidths | Number (double), optional | The amount to scale line widths |
scaleAbout | Transformation, optional | The point to use as anchor, to transform about |
Returns
Section titled “Returns”Nothing.
TextFrameItem.rotate()
Section titled “TextFrameItem.rotate()”app.activeDocument.textFrames[index].rotate( angle [,changePositions] [,changeFillPatterns] [,changeFillGradients] [,changeStrokePattern] [,rotateAbout])
Description
Section titled “Description”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.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
angle | Number (double) | The angle amount to rotate the element |
changePositions | Boolean, optional | Whether to effect art object positions and orientations |
changeFillPatterns | Boolean, optional | Whether to transform fill patterns |
changeFillGradients | Boolean, optional | Whether to transform fill gradients |
changeStrokePattern | Boolean, optional | Whether to transform stroke patterns |
rotateAbout | Transformation, optional | The point to use as anchor, to transform about |
Returns
Section titled “Returns”Nothing.
TextFrameItem.transform()
Section titled “TextFrameItem.transform()”app.activeDocument.textFrames[index].transform( transformationMatrix [, changePositions] [, changeFillPatterns] [, changeFillGradients] [, changeStrokePattern] [, changeLineWidths] [, transformAbout])
Description
Section titled “Description”Transforms the art item by applying a transformation matrix.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
transformationMatrix | Matrix | Transformation matrix to apply |
changePositions | Boolean, optional | Whether to change Positions |
changeFillPatterns | Boolean, optional | Whether to change Fill Patterns |
changeFillGradients | Boolean, optional | Whether to change Fill Gradients |
changeStrokePattern | Boolean, optional | Whether to change Stroke Pattern |
changeLineWidths | Number (double), optional | The amount to scale line widths |
transformAbout | Transformation, optional | The point to use as anchor, to transform about |
Returns
Section titled “Returns”Nothing.
TextFrameItem.translate()
Section titled “TextFrameItem.translate()”app.activeDocument.textFrames[index].translate( [deltaX] [, deltaY] [, transformObjects] [, transformFillPatterns] [, transformFillGradients] [, transformStrokePatterns])
Description
Section titled “Description”Repositions the art item relative to the current position, where deltaX
is the horizontal offset and deltaY
is the vertical offset.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
deltaX | Number (double), optional | Horizontal offset |
deltaY | Number (double), optional | Vertical offset |
transformObjects | Boolean, optional | Whether to transform Objects |
transformFillPatterns | Boolean, optional | Whether to transform Fill Patterns |
transformFillGradients | Boolean, optional | Whether to transform Fill Gradients |
transformStrokePatterns | Boolean, optional | Whether to transform Stroke Patterns |
Returns
Section titled “Returns”Nothing.
TextFrameItem.zOrder()
Section titled “TextFrameItem.zOrder()”app.activeDocument.textFrames[index].zOrder(zOrderCmd)
Description
Section titled “Description”Arranges the art item’s position in the stacking order of the group or layer (parent) of this object.
Parameters
Section titled “Parameters”Parameter | Type | Description |
---|---|---|
zOrderCmd | ZOrderMethod | Stacking order arrangement method |
Returns
Section titled “Returns”Nothing.
Example
Section titled “Example”Rotate a text art item
Section titled “Rotate a text art item”// Duplicates and rotates the selected text art item 5 timesif ( 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); } } }}