Not sure if this tip from the "amateur base" helps someone but these days I figured out some things that helped me which I'd like to share.
Kind of related to the topic I started recently OCR Screen Feature as “Location Relative To”? my goal was to place different sized windows of an application to different locations and screens depending on the status of a popup menu.
Using the action "Screen Capture Area" I copied the text from the current popup status as an image to a named clipboard. I then used "OCR Named Clipboard" and saved the result in the same clipboard.
Then I just used "If Then Else" to place and resize the window depending on the status.
So far so good. During my first tests I had issues because the size of the text was pretty small and the contrast (white on grey) also not ideal for OCR. I created a workaround that were able to compensate the issues partly. Before pasting the screen capture to the clipboard I used some actions to paste it into an image editor (in my case Snagit), let this resize the capture to about factor 5, paste the resized result into the clipboard and then run OCR. I also included the deletion of the just temporarily used image in Snagit. Overall it all didn't work too slow.
The first tests I ran on the 30" Apple cinema display with a resolution of 2560x1440. Yesterday I changed to a 4K display and now can confirm that this gives more reliable results without the need to resize the capture. I just stumbled over a related question today whilst searching for additional things. …
Anyway, the experiences of my investigation lead to questions for @peternlewis.
The action "Screen Capture" has some options beside "Area". What I am missing is something similar to window-related mouse actions.
- Would it be possible to scan a specified "Area - i.e. relative to the front windows left corner"?
This would be more precise because the bigger the scanned area the bigger the chance that OCR finds more than one match. Also, the window has to be in a dedicated position. I just found the option to scan entire windows.
- Would it be possible to include the option to resize a captured image by a specified factor before running the OCR action?
Apologies if I maybe missed something that is already possible. Thanks!