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

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 Mode — Captures a desktop screen region by coordinates.
- Browser Mode — Uses 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
- Add the Image › OCR Capture command.
- Draw the scan region on screen (tighter around the text is more accurate).
- (Optional) enter the target text to find.
- Choose the found action (none / move / click / double-click / right-click) and set IF/ELSE Labels. Save.
Every option explained
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
- OCR Capture on the region with the button, target text = "Confirm".
- Found action = Click.
- 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
Verification details
commands/capture.pycore/ocr_engine.py
RunMacro