Loop Files Action—Setting Properties

The Loop Files action is used to loop through the file names in a specified folder, and populate a variable with the file names. You must create the variable first using a Create Variable step. This action is commonly used to perform an action on multiple files, such as resizing a batch of graphics files.

You can elect to retrieve all files in the folder, or use wildcard characters and masks to retrieve only specific types of files.  

When you create a Loop Files step, an End Loop step is created automatically. Place the steps that perform the action on the files between the Loop Files step and the End Loop step. The steps within the block should be indented for visual clarity.

To set Loop Files properties

  1. From the Task Builder Available Actions pane, open the Loop folder and double-click the Loop Files action or drag it into the Steps pane.

  2. In the Folder box, click the Open Folder button and navigate to the folder that contains the files.

  3. In the Populate variable with file name box, select the variable to populate.

  4. To populate a dataset with the file data, enter a name for the dataset in the Create and populate dataset with result information box. (Dataset names must be alphanumeric, begin with a letter, and contain no spaces.)

    The dataset will show the file's name, size, date created, date modified, date last accessed, plus the state of various attributes.

  5. If you want to use only the file names without the paths, select Do not include path information.

  6. To set additional masks and specifications for the file selection, click the Advanced tab, and enter the properties as follows:

  7. To set the Description tab properties, refer to Description Tab Options.

  8. To set the Error Causes and On Error tab properties, refer to Step Error Handling.

  9. When finished, click OK to save settings and close the properties dialog window.

To auto-indent after all steps are added

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

  2. Click the Format button .

See Also

About Actions

Adding Task Steps

Loop Files Action