Set Text Action Icon

Set Text

Declaration

<AMSETTEXT WINDOWTITLE="text" WINDOWCLASS="text" WINDOWHANDLE=number OBJECTCLASS="text" OBJECTTYPE="text" OBJECTNAME="text" OBJECTVALUE="text" OBJECTXPOS="text" OBJECTYPOS="text" CHECKOBJECTCLASS="yes/no" CHECKOBJECTTYPE="yes/no" CHECKOBJECTNAME="yes/no" CHECKOBJECTVALUE="yes/no" CHECKOBJECTPOSITION="yes/no">text</AMSETTEXT>

See Also

Send Keystrokes, Get Text, Check, Select Item, Press

Description

Sets the text of a control on a window. To select an object from an existing window, either use the "Browse..." button or drag the AutoMate icon to the area on the screen. You can only select objects that contain text. To search for partial window titles, use wildcard characters * and ?.

Practical Usage

Used to set the text inside of a control. Using the Set Text action is superior to using the Send Keystrokes <AMSENDKEY> (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. IMPORTANT: Only standard Windows text controls will work with the Set Text Action, many applications use images or other controls that may act like a text control but they are not a native Windows control - the Set Text action will not work with these controls. In these cases other interactivity actions must be used such as Send Keystrokes <AMSENDKEY>.

Parameters

General Tab

Text
Text, Required
MARKUP: ...>My custom text value</AMSETTEXT>

Specifies the text that the target control should be populated with.

Window Title
Text, Required
MARKUP: WINDOWTITLE="Microsoft Internet Explorer"

Specifies the title of the Window that the control search should be restricted to. The value is case-insensitive. NOTE: A Window title is required because without this parameter the action would have to search every control of every single Window on the system which would take an unacceptable amount of time. This parameter supports wildcards (* and ?), for example "*Internet Explorer* would include all Windows containing that text. Note: If this parameter is left blank the action assumes it is searching for a Window title that is blank - to ignore the Window title, use *.

Window Class
Text, Required
MARKUP: WINDOWCLASS="Outlook Express Browser Class"

Specifies the class of the Window to act on. The value is case-insensitive. This parameter supports wildcards (* and ?), for example "*Internet Explorer* would include all Windows classes containing that text. Note: If this parameter is left blank the action assumes it is searching for a Window class that is blank - to ignore the WIndow class, use *.

Window Handle
Number, Optional - Default - 0
MARKUP: WINDOWHANDLE="555735"

Specifies the handle of the Window to act on. If set to 0 or omitted the parameter is ignored.

Type Must Be
Yes/No, Optional Default NO
MARKUP: CHECKOBJECTTYPE="YES"

Specifies that the type parameter will be checked against the control when determining a matching control. When set to NO the type of the control is ignored.

Type
Text, Optional Default ""
MARKUP: OBJECTTYPE="PushButton"

Specifies the type of control that should be checked/unchecked/toggled. The parameter is ignored if "Type must be" is set to NO.

Class Must Be
Yes/No, Optional Default NO
MARKUP: CHECKOBJECTCLASS="YES"

Specifies that the class parameter will be checked against the control when determining a matching control. When set to NO the class of the control is ignored.

Class
Text, Optional Default ""
MARKUP: OBJECTCLASS="SysTreeView32"

Specifies the class of the target control. The parameter is ignored if "Class Must be" is set to no.

Name Must Be
Yes/No, Optional Default NO
MARKUP: CHECKOBJECTNAME="YES"

Specifies that the name parameter will be checked against the control when determining a matching control. When set to NO the name of the control is ignored.

Name
Text, Optional Default ""
MARKUP: OBJECTNAME="Cancel"

Specifies the name of the target control. The parameter is ignored if "Name must be" is set to NO

Value Must Be
Yes/No, Optional Default NO
MARKUP: CHECKOBJECTVALUE="YES"

Specifies that the value parameter will be checked against the control when determining a matching control. When set to NO the value of the control is ignored.

Value
Text, Optional Default ""
MARKUP: OBJECTVALUE="1"

Specifies the value of the target control. The parameter is ignored if "Value must be" is set to NO

Position Must Be
Yes/No, Optional Default NO
MARKUP: CHECKOBJECTPOSITION="YES"

Specifies that the Position X and Position Y parameter will be checked against the position of the control when determining a matching control. When set to NO the position of the control is ignored. The X and Y coordinates specified are relative to the Window specified in the Window Title Parameter (not the screen).

Position X
Text, Optional Default ""
MARKUP: OBJECTXPOS="80"

Specifies the X coordinate position of the control relative to the Window specified in the Window Title Parameter. The parameter is ignored if "Position must be" is set to NO.

Position Y
Text, Optional Default ""
MARKUP: OBJECTYPOS="90"

Specifies the Y coordinate position of the control relative to the Window specified in the Window Title Parameter. The parameter is ignored if "Position must be" is set to NO.

Notes

Window Dissection™ Technology

This action contains a subset of Unisyn Software's unique "Window Dissection Technology". Click here for more information.

Standard Error Handling Options
This action also includes the standard "Error Causes" and "On Error" failure handling options/tabs

More on Error Handling Options

Variables and Expressions
All text fields allow the use of expressions by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, a popup expression builder is available in all these fields by pressing F2.
More on variables...

More on expressions...

More on the expression builder...

Example

<AMSETTEXT WINDOWTITLE="Run" TEXT="My custom text value" OBJECTCLASS="Edit" OBJECTTYPE="SelectableText" OBJECTXPOS="57" OBJECTYPOS="63" CHECKOBJECTCLASS="YES" CHECKOBJECTTYPE="YES" CHECKOBJECTPOSITION="YES">