Get Area Coordinates to Set KM OCR Action Macro (v9.0.4)

Use Case

  • KM9 introduced a powerful new feature: OCR Screen action
  • Unfortunately, if you want to OCR a specific Area on the screen, you have to enter the coordinates manually. There is no "Get" button like with Found Image.
  • This Macro lets you click on the screen to pick the Left, Top and Right, Bottom points of an Area, and then use that data to actually enter the coordinates in a OCR Action.
  • This Macro was inspired by @Peter_Sanders macro.


MACRO:   Get Area Coordinates to Set KM OCR Action

~~~ VER: 1.0    2019-12-17 ~~~
Requires: KM 9.0.2+   macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

DOWNLOAD Macro File:

Get Area Coordinates to Set KM OCR Action.kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered. It was also uploaded with a HotKey Trigger of CTRL-F1.




  • Get Area Coordinates to Set KM OCR Action


  1. First, make sure you have followed instructions in the Macro Setup below.

  2. Add an OCR Action to your Macro, and make sure it is visible in the KM Editor Window.

  3. Trigger this macro.

    1. Position Mouse to TOP,LEFT of Area to OCR
      CLICK Left Mouse Button to Record Coordinates

    2. THEN Move to BOTTOM,RIGHT of Area to OCR
      CLICK Left Mouse Button to Record Coordinates

    3. Review Displayed Rectangle
      Press "YES" when it is acceptable

    4. Click in the FIRST Coordinate Field of the OCR Action

    Area Coordinates with then be typed into each field.
    Existing data will be overwritten.


  • Carefully review the Release Notes and the Macro Actions
    • Make sure you understand what the Macro will do.
    • You are responsible for running the Macro, not me. ??
      Make These Changes to this Macro
  1. Assign a Trigger to this macro.
  2. Move this macro to a Macro Group that is only Active when you need this Macro.
    • Most likely will be a MG with GLOBAL access.
  3. ENABLE this Macro, and the Macro Group it is in.


  1. KM 9.0+
  2. macOS 10.11.6 (El Capitan)+

TAGS: @OCR @Area @UI


  • While I have given this a modest amount of testing, and to the best of my knowledge will do no harm, I cannot guarantee it.
  • If you have any doubts or questions:
    • Ask first
    • Turn on the KM Debugger from the KM Status Menu, and step through the macro, making sure you understand what it is doing with each Action.

1 Like