The Loop Tree Control action is used to loop through a tree control, such as a Windows Explorer folder tree, and populate a variable with the items in the tree. This action is used to perform some action on a group of folders or items listed in a tree structure.
The tree control must be a standard Windows tree control. Some programs may have tree structures that look and function in a similar way, but if it is not a standard Windows tree control, it will not work with this action. The window containing the tree control must be open when the step runs.
You can create masks to include or exclude selected items, and you can limit the action to include only specified levels of the tree. If tree levels are not specified, all items within the tree will be included in the loop whether they are visible at the time the step runs or not.
When the Loop Tree Control step is created, an End Loop step is created automatically. Place the steps that will be performed on the list items between the Loop Tree Control step and the End Loop step. The steps within the block should be indented for visual clarity.
From the Task Builder Available Actions pane, open the Loop folder and double-click the Loop Tree Control action or drag it into the Steps pane.
In the Populate variable with item text box, select the variable to populate.
Open the window that contains the control, and display the tree control you want to use.
Drag the AutoMate icon from the Loop Tree Control dialog box into
the tree control.
A black outline appears around the tree control when it is selected. When you release the mouse button, the dialog box is automatically populated with the tree control specifications.
To change any of the tree control specifications, click the Edit button and edit the specifications as needed.
Click the Advanced tab and enter the properties as follows:
Use either Include
items or Exclude items to
enter all or part of the tree items that you want to include or ignore.
You can use asterisk (*) and question mark (?) as wildcard characters.
If you make entries in the Include items box, all items that do not match your entries will be ignored. If you make entries in the Exclude items box, only the specified items will be ignored and all others will be included.
If you want specify a single level of the tree to be included, select Loop exclusively through items at level, and then enter the level in the box below. Zero is root level.
If you want to populate a variable with the tree level for each item, select the variable in the Populate variable with item level box. The variable must be created in an earlier step using the Create Variable action.
To populate a dataset with the tree control data,
select Create and populate dataset and
enter a name for the dataset in the box. (Dataset names must be alphanumeric,
begin with a letter, and contain no spaces.)
The dataset fields will show the index, level, and text of the current node, as well as the parent index and text. Additionally, an IsExpanded field shows whether or not the node has children and is expanded.
If you want the items looped in ascending or descending alphabetical order, make your selection in the Sorting box. By default, items are looped in the order they appear in the tree structure.
To set the Description tab properties, refer to Description Tab Options.
To set the Error Causes and On Error tab properties, refer to Step Error Handling.
When finished, click OK to save settings and close the properties dialog window.
In the Task Builder Steps pane, hold down SHIFT and click the first and last steps in the block so that the complete block of steps is selected.
Click the Format button .
Adding Task Steps
Loop Tree Control Action