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.
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.
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.
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
to refer to the first three paragraphs in the active
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
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 ascending text range Required. An expression that returns a text range object.
This example sorts the paragraphs in the active document in ascending order.
sort ascending text object of active document