UseOCREngine

Capture function.

The UseOCREngine function specifies which OCR engine will be used by subsequent OCR function calls (not available in WinTask Lite)

Syntax

ret=UseOCREngine(1)
or
ret=UseOCREngine(2)

Parameter

UseOCREngine(1) : the subsequent OCR function calls will use MODI OCR engine.

UseOCREngine(2) : the subsequent OCR function calls will use WinTask OCR engine.

Return value

Ret, numeric return code. If the specified OCR engine is ready for use, the return code is 0. If the specified OCR engine is not ready (typically, MODI from Microsoft Office, is not installed), the return code is 1. If #IgnoreErrors=0 (default value), an error message is returned and script execution stops. If #IgnoreErrors=1, the function returns the error code 1 and script execution goes on.

Remarks

When the OCR engine is not specified within a script, the OCR function calls use WinTask OCR engine.

If UseOCREngine is invoked in the middle of a script, the subsequent OCR function calls use the new value for the OCR engine.

See also

CaptureAreaOCR$

CaptureOCR$

ClickOnTextOCR

Pause on OCR Text

Examples

var$=CaptureOCR$("NOTEPAD.EXE|Edit|Untitled - Notepad|1",1) 'var$ returns the OCRized text which is seen in the Notepad window.
'The OCRengine used is the WinTask one as UseOCREngine is not invoked before.

UseOCREngine(1)
var$=CaptureOCR$("NOTEPAD.EXE|Edit|Untitled - Notepad|1",1) 'var$ returns the OCRized text which is seen in the Notepad window.
'The OCRengine used is the MODI one.

UseOCREngine(1)
var$=CaptureOCR$("NOTEPAD.EXE|Edit|Untitled - Notepad|1",1,"Japanese") 'var$ returns the OCRized text which is seen in an English Notepad window using Japanese language for the text within the notepad window.
'The OCRengine used is the MODI one.