TextRange

A range of characters from a text item.

Methods:

changeCaseTo, deSelect, duplicate, getParagraphLength, getTextRunLength, move, remove, removeAll, select

Objects:

CharacterAttributes, CharacterStyles, Characters, InsertionPoints, Lines, ParagraphAttributes, ParagraphStyles, Paragraphs, Story, String, TextRange, TextRanges, Words

Property Listing

Property

Type

Access

Description

characterAttributes

CharacterAttributes

readonly

The character properties for the text range.

characterOffset

Int32

read/write

Offset of the first character of the range from the beginning of the story, in characters.

characterStyles

CharacterStyles CharacterStyle

readonly

List of referenced character styles in the text range.

characters

Characters

readonly

All the characters in this text range.

contents

String

read/write

The text string.

end

Int32

read/write

End index of the text range.

insertionPoints

InsertionPoints InsertionPoint

readonly

All the insertion points in this text range.

kerning

Int32

read/write

Controls the spacing between two characters (in milli-ems)

length

Int32

read/write

Length of text range.

lines

Lines

readonly

All the lines in this text range.

paragraphAttributes

ParagraphAttributes

readonly

The paragraph properties for the text range.

paragraphStyles

ParagraphStyles ParagraphStyle

readonly

List of referenced paragraph styles in the text range.

paragraphs

Paragraphs

readonly

All the paragraphs in this text range.

parent

 

readonly

The object's container.

start

Int32

read/write

Start index of the text range.

story

Story

readonly

The story of the text range.

textRanges

TextRanges TextRange

readonly

All the text in this text range.

textSelection

Array of TextRange

readonly

The selected text (ranges) in the text range.

typename

String

readonly

The class name of the object.

words

Words

readonly

All the words in this text range.

Method Listing

undefined changeCaseTo (type:CaseChangeType)

Change the capitalization of text.

Parameter

Type

Description

type

CaseChangeType

CaseChangeType.LOWERCASE

CaseChangeType.SENTENCECASE

CaseChangeType.TITLECASE

CaseChangeType.UPPERCASE

The type of case.

undefined deSelect ()

Deselect the text range.

TextRange duplicate (relativeObject:Object, insertionLocation:ElementPlacement)

Duplicate this object.

Parameter

Type

Description

relativeObject

Object

 

insertionLocation

ElementPlacement

 

Int32 getParagraphLength ()

Get the length of the first paragraph.

Int32 getTextRunLength ()

Get the length of the first text run.

TextRange move (relativeObject:Object, insertionLocation:ElementPlacement)

Move the object.

Parameter

Type

Description

relativeObject

Object

 

insertionLocation

ElementPlacement

 

undefined remove ()

Deletes this object.

undefined removeAll ()

Deletes all elements.

undefined select ([addToDocument:Boolean=Boolean])

Select the text range.

Parameter

Type

Description

addToDocument

Boolean

Whether to add the text range to the document text selection.

(default: false)

Object of

Story.textSelection

TextFrameItem.textSelection

TextRange.textSelection

Story.textRange

TextFrameItem.textRange

Return

Characters.addBefore()

Words.addBefore()

Paragraphs.addBefore()

Characters.add()

Paragraphs.add()

Words.add()

TextRange.duplicate()

TextRanges.getByName()

Characters.getByName()

Words.getByName()

Lines.getByName()

Paragraphs.getByName()

TextRange.move()