Changing the selection – Nisus Writer Pro User Manual

Page 427

Advertising
background image

Customizing & Automating Solutions

407

This instruction returns the contents of the currently selected text (eg: for placement into a
variable) as for example $my_text = Read Selection

Write Selection text

Currently this behaves exactly the same as Insert Attributed Text. In the future we
may support replacing a multipart selection with a list variable. Right now it is offered
merely for symmetry with Read Selection.

Insert Table rowCount, columnCount, [style]

Inserts a new table with the specified number of rows and columns. The style argument
can be the string "plain", "row headers", "column headers", or "both headers".

Bookmark
Bookmark As name

The first command creates an auto-named bookmark and applies it to the currently
selected text. The second creates the bookmark with the specified name.

Changing the selection

Select All

Selects all the content in the document.

Select Start
Select End

Places the caret (insertion point) at the start or end of the current selection respectively.
The way to make sure the insertion point is at the start of the document is to first Select All
then Select Start. Similarly for placing the insertion point at the end of the document.

Select Bookmark name

Selects the text with the specified bookmark.

Select Table number
Select Image number
Select Note number
Select Note Reference number
Select Page number

Selects the Nth object (eg: table, image, etc) in the document, that is, starting the count
with the very first object in the document, so this is not dependent on the position of the
insertion point or cursor. Eg: Select Image 2 will select the 2nd image in the document.

Select Next Table
Select Next Image
Select Next Note
Select Next Note Reference

Selects the next object (table, image, etc) that appears after the current selection. These
instructions return false if there is no next object.

Select Table Cell row, column

Selects the table cell with the given coordinates. If the selection currently rests inside a
table, then the cell is selected in that table. If no table is currently selected then selects the
cell in the first table after the selection.

selected storage length

Returns the number of characters in the text storage (eg: document body, header, table cell,
etc) that contains the first selection.

selection count

Returns the number of non-contiguous selections in the document. Returns 1 if there is a
single selection or a zero length selection (the caret). NOTE: if more than one text storage is
selected (eg: multiple table cells) then this count only includes selections in the text storage
containing the first selection.

selection location

Returns the index (1-based) of the first character in the selection. If the selection is zero
characters in length then this returns the index of the character that follows the caret. This
command optionally takes a (1-based) index that specifies selection's location to return (eg:
the 2nd selection in the document).

selection length

Advertising