CTextView:Attach


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

The related AttachFromList method attaches the image window selected from a list of all open image windows.

Syntax

CTextView_obj = CImage:Attach()

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

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

Example

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

T = attach_textview()

-- attach the top-most text window

if T == nil then Exit() end

-- if not successful, exit the script

Printf("Attached textview %s\n", T:GetTitle())

-- print the title of the attached window

Related Topics

CTextView class, new, AttachFromList, attach_textview, attachlist_textview


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