Skip to content

Ocr

Optical Character Resolution (OCR) object. Use it to recognize text on the screen. Requires Rapise 8.3+.

Action Summary

Action Description
DoClickTextInObject Does OCR for a given object, finds a given string and clicks on it.
DoClickTextInWindow Does OCR for a window that contains a given object, finds a given string and clicks on it.
DoExtractFromImage Does OCR for 'img'.
DoExtractFromObject Does OCR for a given object.
DoExtractFromScreen Does OCR for a given rectangle.
DoExtractFromWindow Does OCR for a window that contains a given object.
DoSelectOcrEngine Selects OCR engine by name.

Action Detail

DoClickTextInObject

Does OCR for a given object, finds a given string and clicks on it.

Ocr.DoClickTextInObject(objId, text, clickType)

Parameters:

Name Type Description
objId objectId | SeSObject ID of an object or SeSObject instance.
text string Text to find.
clickType string Type of a click to perform ("L"

Returns:

'true' if the text was found, 'false' otherwise.

DoClickTextInWindow

Does OCR for a window that contains a given object, finds a given string and clicks on it.

Ocr.DoClickTextInWindow(objId, text, clickType)

Parameters:

Name Type Description
objId objectId | SeSObject ID of an object or SeSObject instance.
text string Text to find.
clickType string Type of a click to perform ("L"

Returns:

'true' if the text was found, 'false' otherwise.

DoExtractFromImage

Does OCR for 'img'.

Ocr.DoExtractFromImage(img)

Parameters:

Name Type Description
img SeSWrappers.Utils.ImageWrapper | String Image (ImageWrapper object or path to a file) to do OCR.

Returns:

Recognized text or empty string in the case of an error.

DoExtractFromObject

Does OCR for a given object.

Ocr.DoExtractFromObject(objId)

Parameters:

Name Type Description
objId objectId | SeSObject ID of an object or SeSObject instance.

Returns:

Recognized text or empty string in the case of an error.

DoExtractFromScreen

Does OCR for a given rectangle.

Ocr.DoExtractFromScreen(left, top, right, bottom)

Parameters:

Name Type Description
left number X-coordinate of the top left corner.
top number Y-coordinate of the top left corner.
right number X-coordinate of the bottom right corner.
bottom number Y-coordinate of the bottomo right corner.

Returns:

Recognized text or empty string in the case of an error.

DoExtractFromWindow

Does OCR for a window that contains a given object.

Ocr.DoExtractFromWindow(objId)

Parameters:

Name Type Description
objId SeSObject | String ID of an object or SeSObject instance.

Returns:

Recognized text or empty string in the case of an error.

DoSelectOcrEngine

Selects OCR engine by name. The name should point to installed OCR engine. Default pre-selected enigne is windows.

Ocr.DoSelectOcrEngine(ocrName)

Parameters:

Name Type Description
ocrName string Name of an OCR engine available to Rapise:windows or tesseract.