Use macOS Keychain to Get Password for Mac App [Example] Macro (v9.0)

MACRO:   Use macOS Keychain to Get Password for Mac App [Example]

~~~ VER: 2.0    2019-08-18 ~~~
Requires: KM 9+   macOS 10.11 (El Capitan)+
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

DOWNLOAD Macro File:

Use macOS Keychain to Get Password for Mac App [Example].kmmacros
Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.


My thanks for @appleianer and others who pioneered this method of auto-fill-in of App passwords.

CAUTION: Use at your own risk

  • This macro provides a means of getting secure data from your macOS Keychain, and very, very briefly (< 0.5 sec) exposes that data as unencrypted text, although the text is never shown.
  • The secure data is stored only in a KM Local Variable, which ceases to exist as soon as the macro completes execution.
  • This macro is provided as an educational tool, and not intended for production use.
  • Anyone who can log in to your Mac using your login credentials has access to your macOS keychain data.
  • The author is not liable for any losses you sustain from using this material.




  • Fill In Mac App Password Using macOS Keychain
    • Not as Secure as 1PW, but Good Enough in Most Cases


  1. First, make sure you have followed instructions in the Macro Setup below.
  2. Launch your Mac App and invoke its login window
  3. Trigger this macro.


  • 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.
  3. ENABLE this Macro, and the Macro Group it is in.
    (all shown in the magenta color)
    • PAUSE UNTIL: App Login Window Appears
      • Change Condition as needed for your app
    • Move and Click in Password Field Based on Login Window Image
      • Change Image in Action Image well to match your App Window
      • Change offset X and Y to match your password field
    • Set Variable “PasswordForApp” to Keychain Password “KeychainPWname”
      • Change "Keychain paswword named" to name you use in your keychain.


  1. KM 9.0+ (may work in KM 8.2+ in some cases)
  2. macOS 10.11.6 (El Capitan)+

TAGS: @Security @Keychain @Login


  • Any Action in magenta color is designed to be changed by end-user


  • To facilitate the reading, customizing, and maintenance of this macro,
    key Actions are colored as follows:
  • GREEN -- Key Comments designed to highlight main sections of macro
  • MAGENTA -- Actions designed to be customized by user
  • YELLOW -- Primary Actions (usually the main purpose of the macro)
  • ORANGE -- Actions that permanently destroy Variables or Clipboards,
    OR IF/THEN and PAUSE Actions


  • 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.