Text Suite
466
Command: move range start until
Moves the start position of the specified text range until one of the specified characters is found in
the document. If the movement is backward through the document, the text range is expanded. Use
this command to return a new text range object.
Syntax
move range start 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
If there's a dollar sign character ($) in the first paragraph in the selection, this example moves
myRange
just before the dollar sign.
set myRange to text object of paragraph 1 of active document
set len to (end of content of myRange) - (start of content of myRange)
collapse range myRange direction collapse start
set myRange to move range start until myRange characters "$" count len
Command: move range start while
Moves the start position of the specified text range while any of the specified characters are found in
the document. Use this command to return a new text range object.
Syntax
move range start 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 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 moves the start position of the text range of the selection backward through the
document while the space character is found.
set strt to move range start while text object of selection characters " " ¬
count go backward
This example moves the start position of the text range backward through the document while
count is less than or equal to 10 and any letter from "a" through "h" is found.
set strt to move range start while text object of selection characters ¬
"abcdefgh" count -10