Text Suite
465
Command: move range end until
Moves the end position of the specified text range until any of the specified characters are found in
the document. If the movement is forward in the document, the text range is expanded. Use this
command to return a new text range object.
Syntax
move range end until text range Required. An expression that returns a text range object.
characters Unicode text Required. One or more characters. This argument is case sensitive.
[count integer\constant] Optional. The maximum number of characters by which the specified
range or selection is to be moved. Can be a number or either the go forward or go backward
constant. If count is a positive number, the text range is moved forward in the document. If its
a negative number, the text range is moved backward. The default value is go forward.
Example
This example extends the selection forward in the document until the letter "a" is found, and then
expands the selection to include the letter "a".
set selObj to move range end until (text object of selection) characters "a" ¬
count go forward
select selObj
extend selection character "a"
Command: move range end while
Moves the ending character position of a range or selection while any of the specified characters are
found in the document. Use this command to return a new text range object.
Syntax
move range end while text range Required. An expression that returns a text range object.
characters Unicode text Required. One or more characters. This argument is case sensitive.
[count integer\constant] Optional. The maximum number of characters by which the range or
selection is to be moved. Can be a number or either the go forward or go backward constant. If
count is a positive number, the text range is moved forward in the document. If its a negative
number, the range or selection is moved backward. The default value is go forward.
Example
This example moves the end position of the selection forward while the space character is found.
set myRange to move range end while text object of selection characters " " ¬
count go forward
This example moves the end position of the selection forward while count is less than or equal to 10
and any letter from "a" through "h" is found.
set myRange to move range end while text object of selection ¬
characters "abcdefgh" count 10