Scan OCR Command Reference (Region, Clipboard & Image File)
Desktop ModeRunMacro 3.5+
Scan OCR is an offline optical character recognition command in RunMacro that extracts text from screen regions, image files, or clipboard and assigns it directly to variables.
Dialog & quick setup

- In RunMacro, open the Image › Scan OCR command.
- Select the Source: Screen region, Image file, or Clipboard.
- If selecting screen, click Pick Region and drag a bounding box around the text area.
- Select the Output target: variable, clipboard, both, or file.
- Specify the Result variable name (default
ocr_text). - Click Save. During execution, detected text is stored in variable
{ocr_text}.
Options reference
Modes & when to use
Desktop Mode
Captures DPI-aware bitmap via Windows GDI and processes through local OCR engine.
Best for
- Reading OTP codes or numerical captchas from secured apps that prohibit text selection or copying.
- Extracting transaction amounts, bank account numbers, or order IDs from payment receipts and screenshots.
- Reading data from virtualized remote desktops (RDP, Citrix, AnyDesk, TeamViewer) where UIA is inaccessible.
- Digitizing scanned paper documents and invoice snapshots into structured digital text.
Use an alternative when
- Desktop controls exposing native text via UIA (use Smart Get Text for 100% precision and 10x speed).
- Standard web pages (use Smart HTML DOM text extraction).
Before you run
- Screen region or image file contains visible, legible text.
Example workflow
Example: Scan 6-digit OTP code from screen popup
- Add a Scan OCR command following the OTP request step.
- Click Pick Region and draw a box around the OTP display area.
- Set Result Variable to
ma_otp. - Add an Extract Regex command with pattern
\d{6}to isolate the 6 digits. - Use Smart Type to fill the captured OTP into the verification input.
Expected result: The recognized text string is saved to the specified variable or clipboard without external third-party tools.
Tips & limitations
Cropping the region tightly around the target text maximizes OCR speed and recognition accuracy.
If text is blurry or minuscule, scale the target window or zoom in for optimal OCR recognition.
- Heavily stylized handwriting or calligraphy may yield reduced confidence scores.
- Heavily compressed or low-bitrate JPEG artifacts degrade accuracy.
Applies to RunMacro 3.5+ · Desktop Mode · Windows 10/11
