Bug using apple OCR

,

I am using KM to process information OCR'd (Apple text recognition) from a picture in my filing process in PhotoMechanic.

The weird thing is that the first time I call the Macro ⌘⌃⇧4 captures, often without any clicking from me, the whole screen is captured and processed, instead of my region of interest.

The second time around it works like a charm...

Any idea on how to correct this?

Thank you

Difficult without seeing the rest of the macro, particularly the trigger.

But this isn't a good way to do what you want -- KM has the "Prompt for Screen Rectangle" Action to get a user-defined area, which you can then use in the "OCR Screen" Action.

If you also put the OCRed text into a KM variable which you S'n'R and put the result on the Clipboard ready to Paste you'll not fill your Clipboard History with all those intermediate results.

So something like this (set the trigger to suit):

OCR User-defined Area.kmmacros (3.1 KB)

Thank you for your prompt answer.

My trigger was ⌘⌥⌃⇧O.

The rest of the macro were instructions for navigating PhotoMechanic dialog box fields.

I did not think of using the prompt for rectangle - rookie error...

I implemented your recommendations (including using variables) and it works grand!

Weird anyhow that among all my OCR-relying macros this was the only one that on the first attempt captured everything.

Here is the old macro:

Thank you very much!

I was wondering if the trigger modifiers were conflicting with the keystroke Action -- but now you've posted the full macro I can see you've got that covered. Note that the "Pause Until" O is up Condition isn't necessary because you've used an "is released" trigger -- the macro triggers when the O is released so the Condition will always be true.

Since it's not a conflict with the trigger -- I'm afraid I haven't a clue!

For some reasons many years ago some triggers were not working and adding the "release" of the key made the difference, to be safe since then I put it in all my macros...

Or possibly a pause? (Note:I haven't reviewed the original macro.)