Interactivity - Get text

Declaration

<AMINTERACT WINDOWTITLE="text" WINDOWCLASS="text" WINDOWHANDLE="text" ACCESSIBILITYENGINE="text (options)" OBJECTPROPERTIES="Toolkit=text,Type=text,Class=text,Name=text,Value=text,X=number,Y=number" TEXTPROPERTY="value" RESULTVARIABLE="text" />

Related Topics   

Description

Extracts the text contents of a control in a window and populates a variable with results. To select a control from an existing window, drag and release the magnifier icon over the desired control. Use the Browse... button to define additional properties in order to precisely specify a matching control.

NOTE: This activity supports selection of an object or control only if it contains text.

Practical Usage

Used to retrieve the text contents of a control in a window. Using the Get Text action is superior to using the Copy (Clipboard) action or other methods (where it is able to be used) because it communicates with the target control natively and the application is not required to be in the foreground for the event to occur.

Parameters

General

This activity comprises AutoMate's Window Dissection technology to facilitate the discovery of existing window objects and controls. To select the target control:

  1. Make certain the window that contains the desired control is open and in the foreground (in front of all other open windows).
  2. Drag and release the magnifier icon over the control. If the control is supported by this activity, a green border will appear around it.
  3. Upon release, the Edit portion of the editor is populated with identified properties of the control. Individual control properties can be enabled/disabled or further modified via the Edit section.

Property

Type

Required

Default

Markup

Description

Populate variable with text

Text

Yes

(Empty)

RESULTVARIABLE="theVar"

The name of an existing variable that should be populated with the text contents of the desired control.

Get text from

Text (options)

Yes

Auto-detect

  1. TEXTPROPERTY="name"

  2. TEXTPROPERTY="value"

Determines which property should be specified when retrieving text from a control. Every control in a window has both a Name and Value property. For example, in Internet Explorer, a "link" control returns the text displayed on the page for the Name property, and the target URL for the Value property. The available options are:

  • Auto-detect - The action will choose which property to use based on populated values. If the Name property is populated with text and Value property is blank, then Name will be used. If the Value property contains text and the Name property is blank, then Value will be used. If both properties are populated, Name will take precedence over Value.

  • Value property - The Value property will be returned.

  • Name property - The Name property will be returned.

Edit

Property

Type

Required

Default

Markup

Description

By window title

Text

Yes

(Empty)

WINDOWTITLE="Microsoft Internet Explorer"

If enabled, specifies the title of the window that the control search should be restricted to. If disabled, this parameter is ignored. Click the down arrow to select a title from the drop-down list that appears or enter a title manually in the provided text-box. This parameter supports wildcard characters (i.e. * and ?). For example,  entering *Internet Explorer* would restrict the search to only windows containing the text "Internet Explorer" in its title.

By window class

Text

No

(Empty)

WINDOWCLASS="Outlook Express Browser Class"

If enabled, specifies the class of the window that the control search should be restricted to. If disabled, this parameter is ignored. Click the down arrow to select a window class from the drop-down list that appears or enter a window class manually in the provided text-box. This parameter supports wildcard characters (i.e. * and ?). For example,  entering *Internet Explorer* would restrict the search to only window classes containing the text "Internet Explorer."

By window handle

Number

No

(Empty)

WINDOWHANDLE="555735"

If enabled, specifies the handle of the window that the control search should be restricted to. If disabled or set to 0, this parameter is ignored. Use this parameter as a way to  distinguish a particular window from other instances containing an identical title/class.

Accessibility engine

Text (options)

No

Auto

  1. ACCESSIBILITYENGINE="auto"

  2. ACCESSIBILITYENGINE="active"

  3. ACCESSIBILITYENGINE="java"

  4. ACCESSIBILITYENGINE="ie"

The accessibility engine that this activity will use to programmatically gather accurate information about a user interface in order to interact with it. The available options are:

  • Auto (default) - AutoMate will detect the best accessibility engine to use based on current properties.
  • Active - Active Accessibility will be used. Active Accessibility is Microsoft's standard for exposing information about its user interface.
  • Java - Java Access Bridge will be used, which is a technology that enables certain Java applications and applets to be visible to assistive technologies on Microsoft Windows systems.
  • Internet Explorer - Internet Explorer DOM will be used, which is the Document Object Model used to represent objects in a web page (i.e. text, images, headers, links, etc.).

Object properties

Text

No

(Varies)

OBJECTPROPERTIES=

"Toolkit=WindowsAccessibility,

Type=data, Class=DockingPane,

Name=Line,Value=text,

X=300,Y=200"

Contains standard window dissection parameters used to describe objects, controls or text inside a window. This section can be used to define additional characteristics in order to precisely designate a window or matching object. To enable/disable a specific property, check or un-check its associated check-box. To modify the value of a specific property simply enter the desired value in the Value field.   Click the Browse... button to open the Object Browser dialog, which can be used to search for additional criteria about a given window. Available object properties are described below.

Toolkit

Text

No

(Empty)

TOOLKIT=WindowsAccessibility

If enabled, specifies that the toolkit (a set of basic building units for graphical user interfaces) will be examined when determining a matching object. If disabled, the toolkit will be ignored.

Type

Text

No

(Empty)

TYPE="PushButton"

If enabled, specifies that the object type (i.e. Button, Checkbox, Trackbar) will be examined when determining a matching object. If disabled, the object type will be ignored.

Class

Text

No

(Empty)

CLASS="SysTreeView32"

If enabled, specifies that the object class (i.e. XTPToolBar, SysTreeView, MDIClient) will be examined when determining a matching object. If disabled, the object class will be ignored.

Name

Text

No

(Empty)

NAME="Cancel"

If enabled, specifies that the object name (the unique identifier for an object) will be examined when determining a matching object. If disabled, the object name will be ignored.

Value

Text

No

(Empty)

VALUE="1"

If enabled, specifies that the value of the object (which usually coincides with the Name property) will be examined when determining a matching object. If disabled, the object value will be ignored.

X

Number

No

(Empty)

X="80"

If enabled, specifies that the object's X coordinate ( a given number of pixels along the horizontal axis of a window starting from the extreme left side) will be examined when determining a matching object. If disabled, the X coordinate will be ignored.

NOTE: The X and Y coordinates are relative to the specified window as opposed to the screen.

Y

Number

No

(Empty)

Y="90"

If enabled, specifies that the object's Y coordinate ( a given number of pixels along the vertical axis of a window starting from the top-most portion) will be examined when determining a matching object. If disabled, the Y coordinates will be ignored.

NOTE: The X and Y coordinates are relative to the specified window as opposed to the screen.

 

Description

Error Causes

On Error

Example

NOTE: The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.

Description

Get auto-detected property value of object matching the following criteria: (window title: 'Download AutoMate - Network Automation - Windows Internet Explorer', object property 'Type' is 'PushButton', object property 'Name' is 'Download Trial', object property 'Class' is 'Internet Explorer_Server'). Store value in 'theVar'.   

<AMINTERACT WINDOWTITLE="Download AutoMate - Network Automation - Windows Internet Explorer" OBJECTPROPERTIES="Type=PushButton,Name=Download Trial,Value=,Class=Internet Explorer_Server,X=,Y=" TEXTPROPERTY="name" RESULTVARIABLE="theVar" />