Wait for Window Action
<AMWAITFORWINDOW WINDOWTITLE="text" WINDOWCLASS="text"
WINDOWHANDLE="number" ALLOWHIDDEN="yes/no" WINDOWHANDLEVARIABLE="text
[variablename]" WINDOWCLASSVARIABLE="text [variablename]"
WINDOWTITLEVARIABLE="text [variablename]" RESULTDATASET="text"
FOCUSWINDOW="yes/no" CHILDWINDOW="yes/no" />
Causes task execution to pause at the current line until the specified window is open, closed, focused, or unfocused.
Commonly used to wait for the appearance or disappearance of a dialog box or window generated by an external application. This can be used to confirm that a process has completed successfully. For example, if automating a report printing process, you could use the Wait for Window action to wait until the dialog box "Report Complete" appears before performing further processing. If the window appears, the task continues, and if not, it fails.
Specifies the action to wait for.
The available options are:
open: wait for the window to be open (default)
close: wait for the window to be closed
focus: wait for the window to be focused
background: wait for the window to be unfocused
Specifies the title of the window to wait for. The value is not case sensitive. This parameter supports wildcard characters (* and ?). For example "*Internet Explorer*" would include all windows containing Internet Explorer.
Specifies the class of the window to wait for. The value is not case sensitive. This parameter supports wildcard characters (* and ?). For example "*Explore*" would include all window classes containing Explore.
Specifies the handle of the window to wait for. If set to 0 or omitted, this parameter is ignored.
When enabled, specifies that the window to wait for is a child window. This option is useful for Multi-Document Interface (MDI) applications, which contain a series of windows contained within one parent window.
When enabled, specifies that the window should be focused when found. This might be used with a Wait for Window to Open action [ACTION="open"] to ensure that the window is also focused at the end of the step.
The Contents tab contains standard window dissection parameters used to describe controls or text inside a window. These parameters are the same on every action that specifies a window and are documented under Window Dissection Parameters.
When enabled, specifies that hidden (non-visible) windows should be included in the window search. By default, hidden windows are considered unavailable.
Specifies the name of an already existing variable that should receive the title of the window that caused the task to continue.
Specifies the name of an already existing variable that should receive the class of the window that caused the task to continue.
Specifies the name of an already existing variable that should receive the handle of the window that caused the task to continue.
Specifies the name of a dataset to be created and populated with data from the window that caused the task to continue. In addition to the standard dataset fields, the dataset will contain the following:
Title: the window title
Class: the window class
Handle: the window handle
This action contains a subset of Network Automation's unique "Window Dissection Technology".
Click here for more information.
This action includes the Description tab for entering a custom step description.
More on setting custom step description
This action also includes the standard Error Causes and On Error failure handling options/tabs.
More on Error Handling Options
All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.
More on variables
More on expressions
More on the expression builder
NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.
<AMWAITFORWINDOW WINDOWTITLE="Google - Windows Internet Explorer" />
<AMWAITFORWINDOW ACTION="close" WINDOWTITLE="AutoMate Discussion Forum - Microsoft Internet Explorer" />
<AMWAITFORWINDOW WINDOWTITLE="AcrobatTrayIcon" ALLOWHIDDEN="YES" WINDOWTITLEVARIABLE="VariableName" RESULTDATASET="DatasetName" />