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 #
| Parameter | Type | Required | Values | What it does |
|---|---|---|---|---|
path | text | Yes | Absolute path or one starting with ~. May contain {{ }} expressions. |
Examples #
Only if the drive is mounted
When
- Press ⌃⌥J
Only if
- If a file exists at /Volumes/Backup
Do
- Show “Backup drive is here”
Only if a config is missing
When
- Press ⌃⌥J
Only if
- If a file doesn't exist at ~/…/tool/config.json
Do
- Show “No config yet”