OCR - mini mouse macro configuration
Beta release and initial inclusion within version 8.3.3.0 (Mar 19 2022)
* See SETUP instructions further down the page under the heading SETUP.
I'm in the process of adding some OCR (Optical Character Recognition) functionality to macro actions. At this stage (as it is in version 8.3.3) its very limited and not quite ready for the full release. I plan to add a condition page graphical interface for this and all the usual GUI design features that go into adding a new condition. The OCR Beta available from Mini Mouse Macro Patreon is almost finished and ready for full release.
The code will work now with version 8.3.3 if you manually add in the action and follow the SETUP steps from the setup section below.
At the moment the action is limited to one image in to convert any text to a string and one English char data set. Consider the action below:
1 | RUN ACTION | OCR | from image G:\mmm\ocr\sample1.png::to string OCR
2 | RUN ACTION | MESSAGE PROMPT | %OCR%::OCR variable::0::OK
3 | IF | STRING VARIABLE | %OCR% | CONTAINS -C | working | MESSAGE PROMPT | %OCR%::OCR variable - FOUND::0::OK
At line 1 we call our OCR action to load in any text it finds within sample1.png to a variable called OCR.
At line 2 we call a Message Prompt to display the variable output of %OCR%.
At line 3 we do a basic string comparison to find the word 'working' within the %OCR% variable.
* See SETUP instructions further down the page under the heading SETUP.
I'm in the process of adding some OCR (Optical Character Recognition) functionality to macro actions. At this stage (as it is in version 8.3.3) its very limited and not quite ready for the full release. I plan to add a condition page graphical interface for this and all the usual GUI design features that go into adding a new condition. The OCR Beta available from Mini Mouse Macro Patreon is almost finished and ready for full release.
The code will work now with version 8.3.3 if you manually add in the action and follow the SETUP steps from the setup section below.
At the moment the action is limited to one image in to convert any text to a string and one English char data set. Consider the action below:
1 | RUN ACTION | OCR | from image G:\mmm\ocr\sample1.png::to string OCR
2 | RUN ACTION | MESSAGE PROMPT | %OCR%::OCR variable::0::OK
3 | IF | STRING VARIABLE | %OCR% | CONTAINS -C | working | MESSAGE PROMPT | %OCR%::OCR variable - FOUND::0::OK
At line 1 we call our OCR action to load in any text it finds within sample1.png to a variable called OCR.
At line 2 we call a Message Prompt to display the variable output of %OCR%.
At line 3 we do a basic string comparison to find the word 'working' within the %OCR% variable.
![]()
|
A full example of OCR IF conditions can be downloaded from ocr_if.mmmacro sample macro.
|

SETUP
OCR needs some companion files located in the same directory as minimousemacro.exe. These files can be downloaded from minimousemacro.com here https://minimousemacro.com/downloads/ocr_files.zip. The source code for these files is located at github.com/charlesw/tesseract/blob/master/ReadMe.md.
Tesseract.dll
tessdata
- eng.traineddata
x86
- leptonica-1.80.0.dll
- tesseract41.dll
x86
- leptonica-1.80.0.dll
- tesseract41.dll
OCR needs some companion files located in the same directory as minimousemacro.exe. These files can be downloaded from minimousemacro.com here https://minimousemacro.com/downloads/ocr_files.zip. The source code for these files is located at github.com/charlesw/tesseract/blob/master/ReadMe.md.
Tesseract.dll
tessdata
- eng.traineddata
x86
- leptonica-1.80.0.dll
- tesseract41.dll
x86
- leptonica-1.80.0.dll
- tesseract41.dll
ERRORS and the Fix
Most errors are fixed by downloading the ocr_files.zip above and extracting it to the same directory as MiniMouseMacro.exe.
03/14/2022 04:16:02.17 PM Playback error: 1 | RUN ACTION | OCR | from image G:\mmm\ocr\sample1.png::to string OCR - Condition execution error Condition invalid action OCR
This error occurs when you are not running version 8.3.3. The OCR action will be included in a beta/limited form from the next update.
03/14/2022 04:12:25.57 PM Playback error: 1 | RUN ACTION | OCR | from image G:\mmm\ocr\sample1.png::to string OCR - OCR companion are missing/corrupt (tessdata directory). See https://turnssoft.com/ocr for setup instructions
This error occures when the tessdata directory is not present in the same directory as MiniMouseMacro.exe. Download ocr_files.zip (above) and extract it to the same directory as minimousemacro.exe.
03/14/2022 04:07:58.16 PM Playback error: 1 | RUN ACTION | OCR | from image G:\mmm\ocr\sample1.png::to string OCR - Condition execution error Could not load file or assembly 'Tesseract, Version=4.1.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
This error occures when Tesseract.dll is not located in the same directory as MiniMouseMacro.exe. Copy the file into the same directory to fix this.
Most errors are fixed by downloading the ocr_files.zip above and extracting it to the same directory as MiniMouseMacro.exe.
03/14/2022 04:16:02.17 PM Playback error: 1 | RUN ACTION | OCR | from image G:\mmm\ocr\sample1.png::to string OCR - Condition execution error Condition invalid action OCR
This error occurs when you are not running version 8.3.3. The OCR action will be included in a beta/limited form from the next update.
03/14/2022 04:12:25.57 PM Playback error: 1 | RUN ACTION | OCR | from image G:\mmm\ocr\sample1.png::to string OCR - OCR companion are missing/corrupt (tessdata directory). See https://turnssoft.com/ocr for setup instructions
This error occures when the tessdata directory is not present in the same directory as MiniMouseMacro.exe. Download ocr_files.zip (above) and extract it to the same directory as minimousemacro.exe.
03/14/2022 04:07:58.16 PM Playback error: 1 | RUN ACTION | OCR | from image G:\mmm\ocr\sample1.png::to string OCR - Condition execution error Could not load file or assembly 'Tesseract, Version=4.1.1.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
This error occures when Tesseract.dll is not located in the same directory as MiniMouseMacro.exe. Copy the file into the same directory to fix this.