OCRImage
OCRImage>filename,result
Not supported in Macro Scheduler Lite
Performs Optical Character Recognition against the specified image file to retrieve text. Returns the recognised text in the result variable.
This function uses the Tesseract OCR engine via the included ocr.dll runtime file. Language files are stored by default in the "tessdata" folder in the main Macro Scheduler program folder. If compiling a macro that uses this function with Macro Scheduler Pro and selecting the option to copy runtime files the compiler will copy the ocr.dll and tessdata folder to the target folder. If you wish to point this function to a different folder that contains a tessdata folder, set the path with the OCR_LANGDIR variable.
To use anything other than the default English language file and specify a different language to use set the OCR_LANGCODE variable. This can be one or more languages. For multiple languages separate the language codes with a + symbol. E.g.:
Let>OCR_LANGCODE=jpn
Let>OCR_LANGCODE=eng+jpn
Macro Scheduler ships with the standard English language file. Other language files can be saved to the tessdata folder. Language files from these repositories are supported:
https://github.com/tesseract-ocr/tessdata_fast
https://github.com/tesseract-ocr/tessdata_best
Note that OCR is processor intensive and therefore can take some time. The larger the file the longer it will take.
See also OCRArea, OCRScreen, OCRWindow
Example:
ScreenCapture>0,0,800,600,%SCRIPT_DIR%\capture.bmp
OCRFile>%SCRIPT_DIR%\capture.bmp,strResult
MessageModal>strResult