Loop Action Icon

Loop Windows Action

Declaration

<AMLOOPWINDOWS RESULTVARIABLE="text [variable]" WINDOWHANDLEVARIABLE="text [variable]" ALLOWHIDDEN="yes/no">
  (block of steps to loop)
</AMLOOP>

See Also

Loop, End Loop, Loop Files, Loop Processes, Loop Expression, Loop Dataset, Loop List, Break

Description

Loops through all of the Windows that are currently open on the system. The variable specified in the Index parameter is updated with the current window title, with each successive loop, the next window title is retrieved. The loop ends after all the open windows have been retrieved or when a Break is encountered.

Practical Usage

To perform an action on every Window open on the system.

Parameters

General Tab

Result Variable
Text, Required
MARKUP: RESULTVARIABLE="varname"

Specifies an already created variable name that should be populated with the next filename on each successive loop.

Include Hidden Windows
Yes/No, Optional - Default = No
MARKUP: ALLOWHIDDEN="yes"

Specifies that invisible (hidden) windows should be included in the loop results.

Window Handle Variable
Text, Optional - Default = "" [none]
MARKUP: WINDOWHANDLEVARIABLE="currentwindowhandle"

Specifies that invisible (hidden) windows should be included in the loop results.

Notes

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...

Examples

<AMVARIABLE NAME="currentwindow">

<AMLOOPWINDOWS RESULTVARIABLE="currentwindow">

  <AMMESSAGEBOX MESSAGETEXT="The Window Title is %currentwindow%">

</AMLOOP>