Wait for File Action
<AMWAITFORFILE ACTION="text [options]" FILE="text" EXCLUDE="text" ISNEWERTHAN="datetime" ISOLDERTHAN=datetime INUSE="yes/no" RESULTVARIABLE="text"RESULTDATASET="text" ATTRFILTER="text" />
Causes task execution to pause at the current line until the specified file meets the specified condition. The action can wait for the file to exist, not exist, or change.
Commonly used to wait for a file generated by an external application to exist or not exist, indicating a process has completed successfully. If the file appears or disappears then the task can move on; otherwise it fails. For example if automating a file download process, after the keystrokes are sent to start the file download, the Wait for File action could be used to wait until the download finishes before performing further steps.
Specifies whether to wait for the file to appear, disappear, or change.
The available options are:
exists: wait until the file exists (or is created).
not_exist: wait until the file does not exist (or is deleted).
changed: wait until the file is changed.
Specifies the file name that AutoMate should wait for.
Specifies the step should continue waiting until the file has not only met the condition but is also no longer in use. This option is useful to ensure, for example, that the task does not continue until a file is done being transferred or written to a folder.
Specifies the name of an already created variable that should be populated by the file name that caused the step to continue. This is especially useful if wildcard characters are used in the File parameter so that the file itself may be referenced in later steps.
Specifies the name of a dataset to be created and populated with the file data for the file that caused the task to continue. In addition to the standard dataset fields, the dataset will contain the following:
Name: the name of the file
Size: the file size
CreatedOn: the file creation date
ModifiedOn: the date the file was last modified
AccessedOn: the date the file was last accessed
Causes the action not to wait for files matching the masks specified. File names or wildcard masks may be used. Multiple entries may be specified by separating them with a pipe symbol (|), for example: *.txt|*.bak
Causes the action to wait 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).
Causes the action to wait 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).
This group of settings causes the action to filter which files to wait for based on the attribute settings of the source files.
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 wait for.
This action includes the Description tab for entering a custom step description.
More on setting custom step description
This action also includes the standard Error Causes and On Error failure handling options/tabs.
More on Error Handling Options
All text fields allow the use of expressions, which can be entered by surrounding the expression in percentage signs (example: %MYVARIABLE%, %Left('Text',2)%). To help construct these expressions, you can open Expression Builder from these fields by pressing F2.
More on variables
More on expressions
More on the expression builder
NOTE: The code below can be copied and pasted directly into the Steps pane of the Task Builder.
<AMWAITFORFILE ACTION="not_exist" FILE="C:\FolderName\*.*" EXCLUDE="*.xml" ISNEWERTHAN="%DateSerial(2007,01,01) + TimeSerial(13,58,36)%" ISOLDERTHAN="%DateSerial(2007,02,27) + TimeSerial(13,58,36)%" RESULTVARIABLE="VariableName1" RESULTDATASET="DatasetName" ATTRFILTER="-r" />