Properties
The index of the first character of the text range inside the story in numbers of characters. Read-only.
- Returns:
- Number
The index of the last character of the text range inside the story in numbers of characters. Read-only.
- Returns:
- Number
Hierarchy
Style Properties
The character style of the text range.
- Returns:
- CharacterStyle
The paragraph style of the text range.
- Returns:
- ParagraphStyle
Character Range Properties
The transformation matrices of the characters in the text range. Read-only.
- Returns:
- Array of Matrix
The character type of the text range. This range has to be of size equal to 1 character.
Sample code:
var text = new PointText(new Point(50, 100)); text.content = 'Text.'; var firstCharacter = text.range.characters.first; print(firstCharacter.characterType) // 'normal' var lastCharacter = text.range.characters.last; print(lastCharacter.characterType); // 'punctuation'Read-only.
- Returns:
- String ('undefined', 'space', 'punctuation', 'paragraph-end', 'normal')
Sub Ranges
The text ranges of the words contained within the text range. Note that the returned text range includes the trailing whitespace characters of the words.
Sample code:
var text = new PointText(new Point(0,0)); text.content = 'The contents of the point text.'; var word = text.range.words[1]; print(word.content) // 'contents ' - note the space after 'contents';Read-only.
- Returns:
- Array of TextRange, read-only
The text ranges of the paragraphs contained within the text range. Note that the returned text range includes the trailing paragraph (\r) characters of the paragraphs.
Sample code:
var text = new PointText(new Point(0,0)); // ('\r' is the escaped character that specifies a new paragraph) text.content = 'First paragraph\rSecond paragraph'; var paragraph = text.range.paragraphs[1]; print(paragraph.content) //returns 'Second paragraph';Read-only.
- Returns:
- Array of TextRange, read-only
The text ranges of the characters contained within the text range.
Sample code:
var text = new PointText(new Point(0,0)); text.content = 'abc'; var character = text.range.characters[1]; print(character.content) //returns 'b';Read-only.
- Returns:
- Array of TextRange, read-only
Functions
Prepends the supplied text to the text range.
- Parameters:
- text: String
Prepends the supplied text range to the text range.
- Parameters:
- range: TextRange
Appends the supplied text to this text range.
- Parameters:
- text: String
Appends the supplied text range to this text range.
- Parameters:
- range: TextRange
Selects the text range.
- Parameters:
- addToSelection: Boolean — If set to true, the text range will be added to the current selection in the document. If set to false, it will clear the current selection in the document and only select the text range. — optional
Deselects the text range in the document. Note that deselecting a text range can cause defragmented selection, if the text range is a subrange of the current selection.
Returns a text range from the story given in indices relative to the current text range's start index.
- Parameters:
- start: Number
- end: Number
- Returns:
- TextRange — sub range
Changes the case of the text in the text range.
Sample code:
var text = new PointText(); text.content = 'the title of a book'; text.range.changeCase('title'); print(text.content); // 'The Title Of A Book'
var text = new PointText(); text.content = 'one two three'; text.range.words[1].changeCase('upper'); print(text.content); // 'one TWO three'
- Parameters:
- change: String ('upper', 'lower', 'title', 'sentence')
- Returns:
- Boolean
Adjusts the tracking of the text in the text range to fit on one line spanning the width of the area text.