Sg 2.9
TextRange
Packages RSS
About
News
Gallery
Scripts
Tutorials
Download
Reference
Forum
Users
License
Twitter

Operators

    Returns:
  • Boolean

Properties

The text content of the text range.

    Returns:
  • String

The index of the first character of the text range inside the story in numbers of characters. Read-only.

    Returns:
  • Number
end

The index of the last character of the text range inside the story in numbers of characters. Read-only.

    Returns:
  • Number

The amount of characters in the range. Read-only.

    Returns:
  • Number

Hierarchy

The document that the text range belongs to. Read-only.

story

The story that the text range belongs to. Read-only.

An array of linked text frames that the text range is contained within. Read-only.

Style Properties

The character style of the text range.

The paragraph style of the text range.

Character Range Properties

The origin points of the characters in the text range. Read-only.

The transformation matrices of the characters in the text range. Read-only.

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.

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.

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.

Functions

Prepends the supplied text to the text range.

    Parameters:
  • text: String

Prepends the supplied text range to the text range.

Appends the supplied text to this text range.

    Parameters:
  • text: String

Appends the supplied text range to this text range.

Deletes all the characters in the text range.

    Returns:
  • Boolean

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.

Clones the text range.

Returns a text range from the story given in indices relative to the current text range's start index.

    Parameters:
  • start: Number
  • end: Number

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.

    Returns:
  • Boolean

AltStyle によって変換されたページ (->オリジナル) /