Robot Task Activities - OCR
The OCR activities read text from an area of the screen with optical character recognition, for applications that do not expose their content as UI elements, such as a rendered document, a remote desktop session or a legacy terminal.

To define the area, click Click to select a area on the activity, then drag with the left mouse button to size the capture box. When the text is inside the box, right-click to save the area.
Search Text and Click
Finds the text in the area and clicks where it was found.

- Click to select a area: opens the capture box to define the screen area to search
- Search text: the text to find in the area
- OCR language: shown on the activity, but recognition always uses English, whatever this field says
- Is Case Sensitive: when checked, the case of the text must match
- CleanBackgroundNoise: in the Properties pane, cleans background noise from the captured image before recognition
The area is stored as TextAreaRectangleX, TextAreaRectangleY, TextAreaRectangleWidth and TextAreaRectangleHeight in the Properties pane. The other click properties, such as MouseButton and PressedKeys, are the same as for the Mouse Click activity.
If the text is not found, the activity clicks the top-left corner of the screen instead, and the Task reports success. Check that the text is on screen first, for example with Wait For Text.
Search Text and Hover
Finds the text in the area and moves the mouse to where it was found. The settings are the same as for Search Text and Click.
Use this to show hover content, such as a tooltip or a menu that only opens when the mouse is over it.
If the text is not found, the activity moves the mouse to the top-left corner of the screen instead, and the Task reports success.
Recognize and Get Text
Reads all the text in the area and saves it to a VisualCron variable.
- VariableToSave: the name of the variable that receives the text
- SaveToVariableType: "User" or "Job". Default: "User"
The text that was read is also written to the Task output. Use this activity to read a value that has no UI element behind it, such as a total in a rendered report.
Wait For Text
Waits until the text in Search text appears in the area, checking every PoolingInterval milliseconds. Default: "300".
Wait For Text has no time limit of its own. If the text never appears, the activity waits until the Task is stopped or the time limit on the Task's TimeOut tab is reached. See Job - Tasks.
Use it instead of a fixed Wait activity to pause until a screen has finished loading, when there is no UI element to test.
Tips
- Keep the area as small as possible. A small area is faster to read and less likely to pick up similar text elsewhere on the screen
- Use OCR when nothing else works. If the application exposes its content as UI elements, the Controls Get Value activity reads it exactly, with no recognition errors. For web pages, use the Web Macro Extract Data or Copy Value activities
- OCR reads what is drawn on the screen, so the target window must be visible and not covered. Use Windows Show Window and Maximize Window first to put the target in a known state
- Screen resolution and display scaling affect recognition. Test OCR activities on the same computer, at the same resolution, that the Job will run on
- Leave Is Case Sensitive cleared unless case is what tells the target apart from other text on the screen. OCR sometimes misreads case