GetContents Function (AnyWin)

Class

AnyWin class.

Action

Returns the contents of the window.

Syntax

lsContents = window.GetContents ([bRawMode])
Variable Description
lsContents The window contents. LIST OF STRING.
bRawMode Optional:TRUE to leave platform-specific information in the strings, or FALSE (default) to remove that information. BOOLEAN.

Notes

GetContents returns text identifying each of the items in the window, preceding the text with the class of the item. Each item in the list corresponds to one window. For example, for the Find dialog box of the Text Editor, GetContents returns the following:

[StaticText]Find What:
[TextField]Find What:
[CheckBox]Case Sensitive
[StaticText]Direction
[PushButton]Find Next
[PushButton]Cancel
[RadioList]Direction

The contents of the list are not affected by any declarations you may have saved for the window.

For objects with no caption, GetContents returns either the prior static text string or an index number for the object.

When bRawMode is TRUE, the returned strings include trailing and leading spaces, ellipses, accelerators, and hot keys. These additional characters make the strings platform-specific. When bRawMode is FALSE, the output of GetContents does not include any special characters.

Example

LIST OF STRING lsItems
WINDOW w
TextEditor.Search.Find.Pick()
w = Desktop.GetActive()
lsItems = w.GetContents()