attach_textview


The attach_textview function is a non-class function that creates a new CTextView object attached to a text editor window displayed on the Mira desktop. The script can then collect data from the window and change its contents. This method selects the top-most text editor window among all windows on the desktop. This function does not use an existing CTextView object. Also see the equivalent class method CTextView:Attach.

The related attachlist_textview function attaches the text editor window selected from a list of all open text editor windows.

Syntax

CTextView_obj = attach_textview()

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.

Example

Assume that several text editor windows are displayed on the Mira desktop, and the window of interest is top-most of all text editor windows. The following script attaches that window to the script:

T = attach_textview()

-- attach the top-most text editor window

if T == nil then Exit() end

-- if not successful, exit the script

Printf("Attached textview %s\n")

-- print the title of the attached window

Related Topics

CTextView class

new

Attach


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