CTextView:AttachFromList


The AttachFromList method creates a new CTextView object attached to a text editor window on the Mira desktop. The script can then collect data from the text editor and change its contents. This function requires the user to select the target window from a list of all text editor windows on the desktop. This function does not use an existing CTextView object. Also see the equivalent non-class function attachlist_textview.

The related attach_textview function attaches the top-most text editor window.

Syntax

CTextView_obj = CTextView:AttachFromList()

bullet.gif    On success, a new CTextView class object is returned.

bullet.gif    On failure, nil is returned. This usually means no text editor window is shown on the Mira desktop.

Remarks

This function collects all text editor windows on the Mira desktop into a list, then displays them in a window where the target text editor window is selected. The selected text editor window is returned as a new CTextView object.

Example

Assume that several text editor windows are displayed on the Mira desktop along with other windows. The following script attaches one of the text editor windows to the script:

T = CTextView:AttachFromList()

-- select the target text editor window

if T == nil then Exit() end

-- if not successful, exit the script

Printf("Attached text editor %s\n")

-- print the title of the attached window

Related Topics

CTextView class, new, attachlist_textview


Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics, Inc. All Rights Reserved.