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 Loop
🔁 Flow

Loop: repeat a block N times in RunMacro

The Loop command is a special IF block: it repeats the commands below until it reaches a set number of iterations (fixed or random).

Prerequisites#

  • Add Loop to the macro.
  • Prepare the data or target that Loop will use.

Supported modes#

  • RunMacro Runner

What it does#

The Loop command is a special IF block: it repeats the commands below until it reaches a set number of iterations (fixed or random). The block is closed with an End If command, and the optional Else branch runs after exhaustion before continuing. A Goto can exit early without running that branch.

Screenshots & video#

RunMacro Loop command configuration dialog showing parameter fields
Configuration dialog and parameter fields for the Loop command in RunMacro.

When to use it#

  • Repeat an action exactly N times (e.g. send 10 messages).
  • Loop a random number of times when you need the count to vary between runs.
  • Retry a sequence a bounded number of times instead of endlessly.

When not to use it#

  • Do not use Loop when repetition should stop on a changing condition; test that condition instead of using a fixed count.

Configuration steps#

  1. Add a Flow › Loop command.
  2. Choose a fixed iteration count, or enable random and set a min–max range.
  3. Put the commands to repeat below, then close the block with an End If command.
  4. (Optional) add an Else branch for what runs after normal exhaustion. Save.

Every option explained#

Loop count (max loops)#

How many times to run the inner block when not random.

Random loop + Min/Max#

Enable so each run picks a random loop count within min–max.

Expected result#

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

Real example#

Example: repeat sending a message 5 times#

  1. Loop with count = 5.
  2. Inside: Type Text + Press Enter.
  3. Close with End If. After 5 iterations, the script continues below.

Limitations and failure cases#

  • The runner manages the counter and the block must close correctly with End If; a Goto out of the block can bypass normal completion.

Tips & common mistakes#

Use a Goto inside the loop to exit early when a stop condition is met.
The loop counter resets automatically when it finishes or the macro restarts.

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.