The Listener output pane’s content and insertion point placement can be controlled with the following methods:
Sets the current text selection in Listener.
The start and end values are the character offsets in the Listener output pane text, starting at 0 .
If the start and end values are the same, no text is selected and the insertion point is placed at the specified point.
You can specify -1 for the start or end values, which specifies the end of the Listener output pane text.
FOR EXAMPLE |
the following would put the insertion point at the end of the text: |
while the following would select all of the text in the Listener output pane text: |
<start_integer> and <end_integer> are integer literals, or expressions that evaluate to an integer.
In versions prior to 3ds Max 2014, this function was unusable because it would return OK and thus destroy the newly set selection with its own return value.
In principle, every MAXScript function must return a value, but this is a very good case for an exception.
Starting with 3ds Max 2014, this function will not return anything and actually select the text in the Listener!
Returns the current text selection indexes as a two-element array, #(start, end) . These values are the character offsets in the Listener output pane text, starting at 0 . If there is no selection, but only an insertion point, the start and end values are equal. Only the selections set using the setListenerSel() method are recognized by this method. If no selection has been set using the setListenerSel() method, the start and end values returned are the offset to the end of the Listener output pane text.
Returns the currently selected text, or an empty string if no text is selected and only the insertion point is showing. Only the selections set using the setListenerSel() method are recognized by this method. If no selection has been set using the setListenerSel() method, an empty string is returned.
Replaces the currently selected text with the replacement string. If no text is selected and only the insertion point is showing, setListenerSelText() inserts the replacement string at the insertion point. Only the selections set using the setListenerSel() method are recognized by this method. If no selection has been set using the setListenerSel() method, the insertion point is the end of the Listener output pane text. < replacement_string > is a string literal or an expression that evaluates to a string.
Inserts the specified file’s content into the Listener output pane. The inserted text is not evaluated. You can use this method to load a script and then step through it, executing any selected text with SHIFT+ENTER. <filename_string> is a string literal or an expression that evaluates to a string, and specifies the name of the file to insert.
If you don’t explicitly specify a directory in the file name, the file will be searched for in the following directories, in the order listed: