Clipboards, User interaction – Nisus Writer Pro User Manual
Page 428

408
The Nisus Writer Pro Macro Language
Returns the number of characters in the selection. Optionally takes a (1-based) index that
specifies which selection's length to return.
selection row index
Returns the (1-based) row index of the first table selection.
selection column index
Returns the (1-based) column index of the first table selection.
selection row count
Returns the number of rows selected by the first table selection. This returns at least one,
even if the table cell is not fully selected (eg: only returns zero if the selection is not in a
table). Note: this is the total number of!rows the selection intersects (eg: this command will
return 2 if the caret rests in a cell that spans 2 table rows).
selection column count
Returns the number of columns selected by the first table selection (see details for row
count).
selected table row count
Returns the total number of rows in the first selected table.
selected table column count
Returns the total number of columns in the first selected table.
set selection location
Sets the (1-based) index of the first character that should be contained in the selection. If
the index is out of bounds, raises an error. Does not alter the length of the selection unless
the new location would place the endpoint of the selection out of bounds, in which case the
selection is clipped to be legal.
set selection length
Sets the number of characters contained in the selection. Does not change the location of
the selection. Raises an error if the new length would cause the selection to be out of
bounds.
select relative table cell
Takes two arguments, the number of rows to move forward by and the number of columns.
You may specify negative numbers to move backwards. Returns true if the move is legal (a
valid cell exists), otherwise returns false and leaves the selection unchanged.
set selection
Takes two parameters, the location of the first character in the selection and the number of
characters to include. This raises an error if the requested selection is out of bounds.
Clipboards
New Clipboard name
Delete Clipboard name
Creates or deletes the respective named Clipboard.
Switch to Clipboard name
Makes the named Clipboard the active (current) Clipboard.
Edit Clipboard [name]
Opens the specified Clipboard in its window for editing. If a name is omitted then the
current Clipboard is opened.
Read Clipboard [name]
Returns the contents of the named Clipboard as a string. If name is omitted then the
current Clipboard contents are read.
This means that $my_text = Read Clipboard [name] stores the returned text into the
variable $my_text.
Write Clipboard contents, [name]
Puts contents into the named Clipboard. If the name is omitted, then the current Clipboard
is used.
User interaction
Prompt message, [detail], [defaultButton], [otherButton]
Displays a message to the user. This instruction returns (that is you can assign it to your
variable) either the string value of defaultButton or otherButton, depending on which
the user clicked. If otherButton is omitted, then the user has only one button to click. The