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.
CTextView_obj = attach_textview() |
On success, a new CTextView class object is returned.
On failure, nil is returned. This usually means no text editor window is shown on the Mira desktop.
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:
|
-- attach the top-most text editor window |
|
-- if not successful, exit the script |
|
-- print the title of the attached window |
Mira Pro x64 Script User's Guide, Copyright Ⓒ 2023 Mirametrics,
Inc. All Rights Reserved.