Browse the docs

File exists

Passes when a file or folder exists at a path.

path exists

Keyboard Maestro: Path, Disk

Details #

Checks the path with the file system. A leading ~ expands to your home folder. Files and folders both count. An empty path never passes.

Every condition accepts "negate": true, which flips the verdict. The trace records what was compared before the flip, so a negated condition that blocks a macro still shows the real values.

Conditions in an Only if list combine with all: every one must pass, and an empty list always passes. An if step or a repeat loop takes a match of all (default) or any.

The trace shows the expanded path and exists.

Parameters #

ParameterTypeRequiredValuesWhat it does
pathtextYesAbsolute path or one starting with ~. May contain {{ }} expressions.

Examples #

Only if the drive is mounted
When
  1. Press ⌃⌥J
Only if
  1. If a file exists at /Volumes/Backup
Do
  1. Show “Backup drive is here”
Open in Switchboard to try it
Only if a config is missing
When
  1. Press ⌃⌥J
Only if
  1. If a file doesn't exist at ~/…/tool/config.json
Do
  1. Show “No config yet”
Open in Switchboard to try it

See also #