Can't Insert Text by Typing in Password Field, El Capitan

I have a KM Insert by Typing macro to insert my system password for those copious prompts by OS X. Since upgrading (clean format and install) to El Capitan it doesn’t work. The macro fires, but not in the Password field of the system prompt. If I hit the shortcut command it will sit forever without typing into into the prompt. As soon as I switch to another application, however, the password is typed out. So it’s only in the system prompt Password field.

Did I forget to enable something in KM or System Preferences when I reinstalled? KM and the Engine ARE enabled in the Accessibility Privacy list.

Any particular password field? I just tried the Fast User Switch and Unlocking the admin account in System Preferences, and both worked without problems.

Note that Typed String triggers will not work in password fields (because the system quite rightly will not let Keyboard Maestro or other applications see typed keys in password fields).

If you recently upgraded, I always recommend that you restart a second time after a system upgrade - that allows the upgraded system to restart cleanly fully upgraded.

I upgraded a couple of weeks ago, and this has been happening since.

It isn’t working for me in the permissions dialog for installing software or in the dialog for deleting certain files. I get the behavior I described above.

For example, the below dialog. KM won't type my password into the field, though it used to.

What does your macro look like?

I suspect secure input is enabled for password fields.

Maybe this tool will help:

Here is what I’ve come up with. The Execute Shell Script action can be used in your own macro if you need to check if Secure Input is on or not. I hope someone finds it useful.

Is Secure Input enabled.kmmacros

Secure Input Mode should be enabled in a password field. But Secure Input Mode should not stop typing in to a password field, only Keyboard Maestro seeing the characters typed while there..

I tried the same password macro you have there with BBEdit’s Install Command Line Tools and had no problems with it:

So either the macro is not firing for some other reason, or something else is blocking the typing.

Open the Console app (/Applications/Utilities/ folder) and click on the ~/Library/Logs/Keyboard Maestro/Engine.log file. When you press the hotkey, it should record an entry like this

2016-06-07 22:41:57 Execute macro ‘Insert Text by Typing’ from trigger The Hot Key ⌥= is pressed

If you don’t see that when you press the trigger key then something is blocking it. Do you have any other keyboard related utilities running like Karabiner, ControllerMate, or BetterTouch Tool?

Just like Peter, I set up a macro as you described above and was able to trigger it to add the text into various password fields. I had KM in the background and could see the :warning:️ icon in the lower right corner meaning Secure Input was enabled. As Peter mentioned, that is expected but should not stop the macro from working.

The only other possibility I can think of is the trigger you are using. Try testing it by using keys on the main keyboard instead of the keypad, like simply the single key ‘p’. I’ve encountered issues with another utility in relation to the keypad keys.

I have Karabiner running, yes. It’s the only way to use my MS Natural Keyboard in El Capitan.

So did the Execute Macro text appear in the Console log when you pressed the trigger or did it appear after switching away from the Secure Input field?

Another option to try is to change the KM macro to run an Applescript instead of typing out text.

tell application "System Events"
    keystroke "Pa$sW0Rd"
end tell

I have Karabiner but don’t have this issue. Check for updates to Karabiner. The current version is 10.19.
Possible that Karabiner is capturing the input during Secure Input mode then releasing when off. Test this by quitting Karabiner and trigger the KM macro.

If you can’t get it working with KM, you could use Karabiner to do it instead. I do the same thing as Karabiner was the only utility (before KM) that was able to enter the text into a Windows VM at the login screen. Windows doesn’t accept a normal Paste action on that screen.

Here is an example of my Karabiner config. This will output Pa$sW0Rd when you press Ctrl+0

<item>
  <name>Test - Secure Input</name>
  <identifier>private.test.secureinput</identifier>
    <autogen>
      __KeyDownUpToKey__
      KeyCode::0, MODIFIERFLAG_EITHER_LEFT_OR_RIGHT_CONTROL | ModifierFlag::NONE,
      KeyCode::VK_LOCK_ALL_FORCE_OFF,
      KeyCode::P,     ModifierFlag::SHIFT_R,
      KeyCode::A,     ModifierFlag::NONE,
      KeyCode::KEY_4, ModifierFlag::SHIFT_R,
      KeyCode::S,     ModifierFlag::NONE,
      KeyCode::W,     ModifierFlag::SHIFT_R,
      KeyCode::KEY_0, ModifierFlag::NONE,
      KeyCode::R,     ModifierFlag::SHIFT_R,
      KeyCode::D,     ModifierFlag::NONE,
    </autogen>
</item>
1 Like

Hey Pariah,

This AppleScript works for me when I install WhatRoute.

The commented-out lines represent detective work and aren’t part of the script proper.

-Chris

tell application "System Events"
   tell application process "SecurityAgent"
      # properties
      # UI elements
      # attributes
      
      tell window 1
         # properties
         # UI elements
         # attributes
         
         tell text field "Password:"
            # properties
            # UI elements
            # attributes
            
            tell attribute "AXValue"
               # properties
               set value to "I Am Nuts!"
            end tell
            
         end tell
         
      end tell
   end tell
end tell
1 Like

My Mac Pro is still on El Capitan and I just realized that this was happening while trying to execute a macro.

If the Action before the Password prompt is displayed is a "Press Button" action, KM basically freezes and will not execute any other action. To exit I would use my Stop All Macros macro and then look in the log to see that no other actions were executed once the password prompt was displayed. Also, their are other actions after the password prompt text insertion that 'should' have been executing and throwing errors, but they were not. If I ran my "Stop All Macros" macro I wouldn't even 'see' the notification from KM for "Cancel All Macros" until after I manually 'quit' the Installer application in which the Password Prompt was displayed; thus KM had to be frozen.

44%20PM

When I removed the "Press Button" action and replaced it with a mouse Move and Click action (to simply 'click' the 'Install' button / which is what the "Press Button" action was supposed to be doing), it works just fine. And I know that KM continues executing other actions because I tested this by removing the inserting of a password and so the prompt just stayed visible - and KM tried other actions and returned errors in the Notification Center. Also, when I ran a Cancel All Macros - I would see the notification from KM "Cancel All Macros" while the Password prompt was still displayed.

03%20PM

Just figured I would add this to the thread because maybe there's something else going on.

1 Like

Yes, this would be the same issue discussed here:

1 Like