Description |
Loops through the file names contained in the folder specified. The variable specified is updated with the current file name. With each successive loop, the next file name is retrieved. The loop ends after all the file names have been retrieved or when a Break is encountered. Used to perform an action on every file in a folder. This action is frequently used to perform actions on files in batches, such as resizing all image files in a folder. |
Declaration |
<AMLOOP TYPE="FOLDER" FOLDER="text"
RESULTVARIABLE="text [variablename]"
ONLYFILENAME="yes/no" SUBFOLDERS="yes/no"
FOLDERS="yes/no" FILES="yes/no"
EXCLUDE="text" SORT="text
[options]" ISNEWERTHAN="datetime" ISOLDERTHAN="datetime"
SORTON="text [options]" ATTRFILTER="text [attribute mask]"
RESULTDATASET="text"> |
Example |
<!---Play every MP3 file in the folder structure---> |
General Tab Parameters |
Folder: Specifies the folder that should be scanned for files. Click the Expression Builder icon to build and insert an expression. Text, Required Populate variable with file name: Specifies an already created variable that should be populated with the next file name on each successive loop. Text, Required Create and populate dataset with result information: Specifies the name of a dataset to be created and populated with the file data for the files in the folder. In addition to the standard dataset fields, the dataset will contain the following:
Text, Optional Do not include path information: If YES (selected), specifies that only the file name and not the path information (drive and folder name) will be returned in the variable or dataset. If NO (default), the full path and file name will be returned. Yes/no, Optional, Default: NO |
Advanced Tab Parameters |
Include mask: Specifies the wildcard mask that should be included in the loop. For example, if *.txt was specified, the loop would include all files that have the extension .txt. (* is specified by default.) Text, Optional, Default: (blank) Exclude mask: Specifies the wildcard mask that should be excluded from the loop. For example, if *.txt was specified, the loop would include all files except those that have the extension .txt. Text, Optional, Default: (blank) Include subfolders: If YES (checked), specifies that the loop will include files or folders inside subfolders of the folder specified. Yes/no, Optional, Default: NO Include folders: If YES (checked), specifies that the loop will include folders as an item to loop. By default folders are not looped. Yes/no, Optional, Default: NO Include files: If YES (checked), specifies that the loop will include files as an item to loop. By default, files are looped. Yes/no, Optional, Default: YES Sorting: Specifies whether a sort order should be applied to the values before the loop begins. For example, selecting ascending would return the files and/or folders in alphabetical order.
Text [options], Optional, Default: "none" Field to sort on: Specifies the field to use in sorting the files. Valid only if Sorting [SORT] is set to ascending or descending.
Text [options], Optional, Default: (file name) |
Date Filter Tab Parameters |
Only if newer than: Causes the action to look only for files newer than the date/time specified. If this parameter is left blank or not included, the date of the files will be ignored (unless limited by the Only if older than [ISOLDERTHAN] parameter). Date, Optional, Default: (none) Only if older than: Causes the action to look only for files older than the date/time specified. If this parameter is left blank or not included, the date of the files will be ignored (unless limited by the Only if newer than [ISNEWERTHAN] parameter). Date, Optional, Default: (none) Click Custom to select from other time options (Last 30 seconds, Last 30 minutes, Last 24 hours, Last 30 Days, Last 12 Months, Last 5 Years, Next 30 Seconds, Next 30 Minutes, Next 24 Hours, Next 30 Days, Next 12 Months, Next 5 Years). A expression appears in the text box (e.g., %DateAdd( "s", -30, CStr( Now() ))%) and the Expression check box is selected. |
Attributes Tab Parameters |
Attributes: This group of settings causes the action to filter which files are processed based on the attribute settings of the source files. In visual mode, a group of controls is provided to assist in the selection of this parameter. In markup mode, a single text item must be specified that contains the attributes of the files you wish to process. The available options are:
Text, Optional (blank) |