Text Suite
479
Command: set range
Sets the starting and ending character positions for the text range.
Note Character position values start at the beginning of the story, with the first value being 0
(zero). All characters are counted, including nonprinting characters. Hidden characters are counted
even if theyre not displayed.
Syntax
set range text range Required. An expression that returns a text range object.
start integer Required. The starting character position of the text range.
end integer Required. The ending character position of the text range.
Remarks
The set range command redefines the starting and ending positions of an existing range object. This
command differs from the create range command, which is used to create a text range, given a
starting and ending position.
Example
This example selects the first 10 characters in the document.
select (set range text object of active document start 0 end 10)
This example uses set range to redefine
myRange
to refer to the first three paragraphs in the active
document.
set myRange to create range active document start (start of content of text ¬
object of paragraph 1 of active document) end (end of content of ¬
text object of paragraph 1 of active document)
set myRange to set range myRange start (start of content of text object of ¬
paragraph 1 of active document) end (end of content of text object ¬
of paragraph 3 of active document)
Command: sort ascending
Sorts paragraphs in ascending alphanumeric order. The first paragraph is considered a header
record and isn't included in the sort. Use the
sort
command to include the header record in a sort.
Note This command offers a simplified form of sorting intended for data merge data sources that
contain columns of data. For most sorting tasks, use the
sort
command.
Syntax
sort ascending text range Required. An expression that returns a text range object.
Example
This example sorts the paragraphs in the active document in ascending order.
sort ascending text object of active document