Text Suite
446
Command: change start of range
Moves or extends the start position of the specified text range to the beginning of the nearest
specified text unit. This command returns a new text range.
Syntax
change start of range text range Required. An expression that returns a text range object.
[by enumeration] Optional. The unit by which to move the starting character position. Can be
one of the following: a character item, a word item, a sentence item, a paragraph item, a line
item, a story item, a screen, a section, a column, a row, a window, a cell, a character
formatting, a paragraph formatting, a table, or a item unit. The default value is a word item.
[extend type enumeration] Optional. Can be either of the following: by moving or by selecting.
If by moving is used, both ends of the text range are moved to the end of the specified unit. If
by selecting is used, the start of the text range is extended to the start of the specified unit. The
default value is by moving.
Remarks
If the beginning of the specified range or selection is already at the beginning of the specified unit,
this command doesn't move or extend the text range.
Example
This example moves
myRange
to the beginning of the second sentence in the document (
myRange
is
collapsed and positioned at the beginning of the second sentence).
set myRange to sentence 2 of active document
set myRange to change start of range myRange by a sentence item ¬
extend type by moving
Command: check grammar
Begins a grammar check for the specified text range. If the text range contains errors, this command
displays the Spelling and Grammar dialog box (Tools menu), with the Check grammar option
selected.
Syntax
check grammar text range Required. An expression that returns a text range object.
Example
This example begins a spelling and grammar check for all stories in the active document.
check grammar text object of active document
This example begins a spelling and grammar check on section two in MyDocument.doc.
set range2 to set range text object of section 2 of document "MyDocument.doc"
check grammar range2
This example begins a spelling and grammar check on the selection.
check grammar text object of selection