If file or folder exists

Syntax

iff[-] file
(tab)	statement
(tab)	...
[else
(tab)	statement
(tab)	... ]
...

 

Can be single line:

iff[-](file) statement ...
[else statement ...]

 

Parts

file - file to search for. Can be file or folder. Also can be drive. Can be full path or filename.

statements - any statements.

Options: - not.

 

Remarks

Similar to if. If file exists, execute statements after iff and skip statements after else (if any). Otherwise, skip statements after iff and execute statements after else.

 

Examples

iff("c:\m\x.txt") mac- "Copy" ;;if file exists, execute macro "Copy"
iff-("notepad.exe") bee ;;if file  doesn't exist, beep
iff(s) out s ;;if file exists, print path. Path is in variable s
iff-("$My Pictures$") end ;;if special folder doesn't exist, end macro