Docs

RunMacro Documentation

Learn RunMacro from basics to advanced.

Everything you need to start and master RunMacro — from basic commands to advanced automation workflows.

RunMacro robot
Docs Image OCR Capture
🔤 Image

Read on-screen text with OCR in RunMacro

OCR Capture reads text in a screen region or a Browser Mode screenshot with Windows OCR. It can find target text, act at its position, and branch on the result; accuracy depends on image quality and OCR availability.

Prerequisites

  • Windows OCR/winsdk is available on the runner machine.
  • The scan region surrounds the target text with sufficient contrast.
  • For Browser Mode, Chrome/CDP is connected and the target to capture is active.

Supported modes

  • Desktop ModeCaptures a desktop screen region by coordinates.
  • Browser ModeUses a screenshot from the selected CDP target.

What it does

The OCR Capture command uses Windows OCR (built into Windows 10/11) to read text from a screen region. You can enter target text to match only when that text is found, then move/click its position and branch IF/ELSE. Works in both Mouse mode and Browser Mode (CDP).

When to use it

  • Read a balance, price, or OTP shown as image/uncopyable text.
  • Find a label/button by its text and click it.
  • Check whether the screen contains a certain text to branch.

When not to use it

  • The text is directly available through Smart HTML or CDP Copy Text.
  • The image is blurred, text is too small, or contrast is poor.
  • You require exact sensitive data without a separate verification step.

Configuration steps

  1. Add the Image › OCR Capture command.
  2. Draw the scan region on screen (tighter around the text is more accurate).
  3. (Optional) enter the target text to find.
  4. Choose the found action (none / move / click / double-click / right-click) and set IF/ELSE Labels. Save.

Every option explained

Scan region

The screen area OCR reads. Draw tightly around the text for better accuracy.

Target text

The string to find in the OCR result. Leave empty to take the first recognized text.

Found action

None (check only) / Move / Click / Double-click / Right-click at the text position.

IF Label / ELSE Label

Jump when the text is found (IF) / not found (ELSE).

Max retries & retry delay (ms)

Repeat the scan to wait for the text (default 10 tries, 200ms each).

Expected result

RunMacro locates the target text in the scan region, performs the configured action at its position (move/click/...), and follows the IF (found) or ELSE (not found) branch. It does not store the recognized text into a variable.

Real example

Example: click a button by its text

  1. OCR Capture on the region with the button, target text = "Confirm".
  2. Found action = Click.
  3. Set an ELSE Label to branch when the text is not found.

Limitations and failure cases

  • OCR can confuse similar characters and does not guarantee exact recognition.
  • When the OCR provider is unavailable, recognition cannot run and the command follows the ELSE branch.
  • DPI, capture-region, or CDP-target changes can alter the result.

Tips & common mistakes

OCR requires Windows OCR (winsdk) to be available; if missing, the command is disabled and follows the ELSE branch. Clear, high-contrast text reads more accurately.

Verification details

  • commands/capture.py
  • core/ocr_engine.py
RunMacro robot

Ready to automate smarter?

Download RunMacro and start automating your desktop, browser, and business workflows today.