Docs

RunMacro Documentation

Create your first robot, then go further as needed.

Clear step-by-step guides to create, run, and improve robots for repetitive computer work.

Docs Flow IF File Exists
📂 Flow

Branch on whether a file/folder exists in RunMacro

The IF File Exists command checks whether a path exists (a file, a folder, or a folder that contains files), then branches: true jumps to IF, false to ELSE.

Prerequisites#

  • Add IF File Exists to the macro.
  • Prepare the data or target that IF File Exists will use.

Supported modes#

  • RunMacro Runner

What it does#

The IF File Exists command checks whether a path exists (a file, a folder, or a folder that contains files), then branches: true jumps to IF, false to ELSE. It supports */? wildcards and variables.

Screenshots & video#

RunMacro IF File Exists command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the IF File Exists command in RunMacro.

When to use it#

  • Only proceed when a data file is present (e.g. a download).
  • Check a folder for new files to batch-process.
  • Skip a step if the output file already exists.

When not to use it#

  • Do not use a one-time existence check to wait for a file that is still downloading or being written.

Configuration steps#

  1. Add a Flow › IF File Exists command.
  2. Enter the path (variables and * allowed).
  3. To only test whether a folder contains files, tick "Only check whether a folder has files" (default ON — it hides the mode picker).
  4. If you untick it, choose the mode in the dropdown: File / Folder / File or Folder.
  5. Set IF/ELSE labels. Save.

Every option explained#

File path#

The path to check. Supports {...} variables and */? wildcards.

Only check whether a folder has files#

A separate checkbox, ON by default. When on, the command only tests whether the folder at the path contains any files, and hides the mode picker below.

Check mode (when the checkbox is off)#

A 3-option dropdown: File, Folder, or File or Folder (either one counts).

IF label / ELSE label#

If it exists jump to IF; otherwise jump to ELSE.

Expected result#

After execution, IF File Exists completes the described action and makes its result available to the next step.

Real example#

Example: process only when a download exists#

  1. IF File Exists, path C:\Downloads, tick "Only check whether a folder has files".
  2. IF label = has_file for the processing steps.
  3. ELSE = wait to wait or exit.

Limitations and failure cases#

  • Existence does not prove a file is complete or readable; wildcards can overmatch and network paths can return transient results.

Tips & common mistakes#

Use * for pattern checks, e.g. *.csv to catch any new CSV file.

Verification details#

  • commands/control_flow.py
RunMacro robot

Robots do the work. Your time is yours.

Create a robot in minutes, no coding needed. Reliable execution, remote management, transparent costs — and you always stay in control.