Text Suite
452
Example
This example cuts the first word in the first paragraph and pastes the word at the end of the
paragraph.
cut object word 1 of paragraph 1 of text object of active document
collapse range text object of paragraph 1 of active document direction ¬
collapse
end
move end of range text object of paragraph 1 of active document by ¬
a character item count -1
paste object text object of selection
This example cuts the contents of the selection and pastes them into a new document.
if selection type of selection is selection normal then
cut object text object of selection
set newDoc to make new document
paste object text object of newDoc
end if
Command: expand
Expands the specified range or selection. Returns a new text range.
Syntax
expand text range Required. An expression that returns a text range object.
[by enumeration] Optional. The unit by which to expand the range. 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.
Example
This example creates a range that refers to the first word in the active document, and then it
expands the range to reference the first paragraph in the document.
set myRange to word 1 of active document
set myRange to expand myRange by a paragraph item
Command: get border
Returns the specified border object.
Syntax
get border text range/section/paragraph/font/Word style Required. The object to get the border
from.
[which border enumeration] Optional. The border to be retrieved. Can be one of the following:
border top, border left, border bottom, border right, border horizontal, border vertical,
border diagonal down, or border diagonal up.