Move mouse pointer to found text while using OCR

I've read quite a few of the threads, but still remain unclear on how to accomplish this – I'm using epic system, and I would like to search for a particular word-"6 months" using OCR.

Next, I would like to move the mouse to the word.
The location of the word changes so it's not in a fixed position.

Neither KM nor macOS allow you to find the location of a word using OCR, but I really needed this functionality myself, so I wrote a very big macro that can accomplish it. You could read the following thread for the instructions on how to use it.

Thank you my friend...I tried using this - but for some reason I see no response when the letters are in Bold. Also - does a particular font matter ?

If @Airy's excellent macro isn't working for you and you are searching a text area to position the cursor at the right place within it, you might be able to do this with OCR by:

  1. OCRing the text area in question
  2. Parsing the text to find the number of words from the start your search term begins at
  3. Putting the cursor at the start of the text area
  4. Moving the cursor forward the appropriate number of words

If you are always searching for the same text, displayed in the same way, it would probably be easier to treat it as a found image instead, click in the middle of the found image, then ⌥← to move to the beginning of the word.

A screen shot, and maybe an explanation of what "epic system" is, would help here.

Bold isn't a problem. Apple's OCR is so good it even works on fonts that appear "hand written."

Font's aren't a problem either, it works with any font that I've tried, but you have to specify a "FontSize" which needs to be the right value. If your value is too small, it will never find the word on the screen because it will be searching for the word in very small boxes. If your value is too large, it will find it but the cursor might miss the word by many pixels. I think this is all described in the thread.

I finally got it - I am using Epic system (medical charting) - and even though the font size looks regular - I went up to size 15 with no results. Today - I tried size # 24 - and it worked !!.

Now another questions. - it only works when the background is white...if the background is any other color - it does not work. Is there a solution to this ? If not - that is ok - I already am grateful for this macro !

Also - if it helps, I can post this question in the original thread so that everybody can see. I just don't wanna go crazy posting multiple places and upset the MODS.

Hi Nige_S - my apologies for not being clear - Epic is a health care, patient charting software and as such - any screenshot would essentially be a screenshot of a patient's chart. As you can imaging - even if there is no identifying information or even if it's just a background - it essentially is violating the HIPPA policy.
Again - I am grateful of your explanation and help !.

1 Like

I have used it mostly on non-white background and I have never seen it fail. So there's probably some other reason why you are having a problem.

Just FYI - works much better after adjusting the resolution on the screen...Thank you!