
This statement 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. Note that when the function fails, the named variables are cleared.
| Tag | Interpretation |
|---|---|
| V | The item is a volume. |
| - | The containing volume is read only. |
| = | The containing volume supports case sensitive names. (ie. not case insensitive). |
| ~ | The containing volume supports preserving case sensitive names. ie. the volume is not case sensitive but preserves names. |
| > | The containing volume is removable. |
| J | The containing volume is ejectable. |
| I | The containing volume is internal to the Mac. |
| L | The containing volume is local. ie. internal or physically connected to the Mac. |
| S | The item is a symbolic link. |
| @ | The item is an alias (produced by the Finder) or a symbolic link. |
| P | The item is a package. A folder treated by the Finder as a single item. |
| A | The item is an application. |
| H | The item is hidden. |
| E | The item is executable. Note that some file sync utilities and various network based players may set this attribute on audio files and folders. |
| D | The item is a directory (folder). |
| F | The item is a file. |
| R | The item can be read. |
| W | The item can be written. (ie. not read only). |
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 or the file's action per file test state. The results track variables, if used, can be the same as the source 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.
When returning the result to the per file test state, true implies exists while false implies does not exist.
When returning the result to a track variable, the following values can be returned. 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. |