If - Folder exists
Declaration
<AMIF ACTIVITY="folder_exist" FOLDER="text" MODE="text (options)" SUBFOLDERS="yes/no" EXCLUDE="text" RE="yes/no" ISNEWERTHAN="date serial" ISOLDERTHAN="date serial">
Description: Determines the existence of a folder and returns TRUE or FALSE depending on the outcome. If the result evaluates to TRUE, the task will execute the block of steps immediately following this step up until an End if step is encountered. If the result evaluates to FALSE, the block will be skipped and execution will proceed directly after the End if step (or if an Else step is encountered, the task will execute that block of steps instead, up until an End if step is encountered). This activity supports wildcard characters (e.g., * or ?).
General Parameters
Property | Type | Required | Default |
Markup |
Description |
---|---|---|---|---|---|
If | Text (Options) | Yes | Folder exists |
ACTION="exist" ACTION="note_exist" |
Specifies the type of evaluation to be performed. The available options are: Folder exists - The IF block will be executed if the specified folder exists. Folder does not exist - The IF block will be executed if the specified folder does not exist. |
Folder | Text | Yes | (Empty) | FOLDER="c:\foldername\" | Specifies path and name of the folder to evaluate. Wildcard characters * or ? are supported. For example, to specify all folders that contain the word 'log', enter "c:\*log*\" |
File Options Parameters
Property | Type | Required | Default |
Markup |
Description |
---|---|---|---|---|---|
Include subfolders |
Yes/No |
No |
No |
SUBFOLDERS="yes" |
If set to YES, denotes that, if present, subfolders should be searched for folders matching the mask specified in the Folder parameter. If set to NO (default), subfolders are ignored. |
Exclude Mask |
Text |
No |
(Empty) |
EXCLUDE="*temp*" |
Causes this activity to omit folders matching the mask specified. Folder names or wildcard masks may be used. Multiple entries may be specified by separating them with a pipe symbol (|). |
Only if newer than |
Date |
No |
(Empty) |
ISNEWERTHAN= "%DateSerial(2007,02,01) + TimeSerial(00,00,00)%" |
Causes this activity to evaluate only folders with a creation date newer than the date/time specified. If this parameter is left blank or not included, the folder date will be ignored. |
Only if older than |
Date |
No |
(Empty) |
ISOLDERTHAN= "%DateSerial(2007,02,01) + TimeSerial(00,00,00)%" |
Causes this activity to evaluate only folders with a creation date older than the date/time specified. If this parameter is left blank or not included, the folder date will be ignored. |
File Filter Parameters
Property |
Type |
Required |
Default |
Markup |
Description |
---|---|---|---|---|---|
Attributes |
Text (options) |
No |
(Empty) |
ATTRFILTER="+R+A-H" (compress read-only & archive files but not hidden files) |
This group of settings causes the activity to filter which folders to look for based on the attribute settings of the source folder(s). In visual mode, a group of controls are 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 look for. Available options are:
|
Description tab - A custom description can be provided on the Description tab to convey additional information or share special notes about a task step.
Error Causes tab - Specify how this step should behave upon the occurrence of an error. (Refer to Task Builder > Error Causes Tab for details.)
On Error tab - Specify what AWE should do if this step encounters an error as defined on the Error Causes tab. (Refer to Task Builder > On Error Tab for details.)
Example
The sample AML code below can be copied and pasted directly into the Steps panel of the Task Builder.
Description
Determines whether folder C:\Temp exists and displays the results in a message box.<AMIF FOLDER="C:\Temp"> <AMMESSAGEBOX>Folder exists.</AMMESSAGEBOX> <AMELSE /><AMMESSAGEBOX>Folder does not exist. </AMMESSAGEBOX></AMIF> |