
This function is used to test if an file system item exists at a supplied path. You can test if the item is a file, a folder or either. There are two modes of operation: Test Path and Test Per File.
If there is an item at the supplied path and it meets the specified criteria, the result of the test will true. Otherwise the result will be false.
The results of the test can be Set, Anded or Ored to the action test state. The test is not performed if it is unnecessary due to the current value of the test state. For example you are Anding to the test state and it is currently false.
The supplied text may contain any of the escape sequences described in Escape Sequences.
Note that at runtime after processing escape sequences, if the path does not start with / or ~/, the test state will be set to false.
The function is only executed once per set of files while executing stepwise.
When the function succeeds (the test state is true), the following named variables will have been populated:
When the function fails, the above named variables will be cleared.
In this mode, the function tests a path contained in a supplied track variable for all active files. The results of the test (based on the specified criteria) are placed into a supplied results track variable. The two track variables can be the same if you wish.
The action test state will be true if all files pass the criteria, otherwise false.
The named variables used by the Test Path mode are not modified.
The result track variable can have the following values. Note that all non zero results imply existence.
| Result | Meaning |
|---|---|
| 0 | The item does not exist. |
| 1 | The item meets the criteria. |
| -1 | The item meets the criteria and is hidden. |
| 2 | This is only possible when the the criteria is Test if the supplied path exists (file or folder). In this case, the item exists and is a folder. 1 is returned for a file. |
| -2 | This is only possible when the the criteria is Test if the supplied path exists (file or folder). In this case, the item exists and is a hidden folder. -1 is returned for a hidden file. |