Cannot enter text into Terminal

10.14.6 (18G5027), KM 9.0.5
I'm having trouble getting text into Terminal. I can create a new window in Terminal, log shows that the macro is executing, Terminal/Secure Keyboard Entry is not checked. I've restarted Terminal, and KM Engine. I don't have any other autotyper programs that I'm aware of. What do I try next?

This is all I've got:
Cancel All Other Macros
Activate Terminal
Pause for 1.5 Seconds
Insert Text “man rsync%Return%” by Typing to Terminal

Thx for any tips.
Ken G. Brown

For my Terminal/iTerm shortcuts I use the Insert Text by Pasting action and just include the return (not the token for it) at the end of the line.

Tried Insert Text by Pasting, get nothing in the new Terminal window.

Now have:
Cancel All Other Macros
Activate Terminal
Select “Basic” in the Menu “Shell” in Terminal
Pause for 1.5 Seconds
Insert Text “man rsync↩” by Pasting
Play Sound “Glass”

Use my Directory macro as a template and let me know what happens.

Directory: File Space Usage.kmmacros (1.7 KB)

If you create a macro in the Global Macro Group, with Typed String trigger “=x=” and Insert Text by Typing action “hello”, which you can then test anywhere, does that work in Terminal?

If it does not:

  • does the “=x=” get deleted?
  • Add a Alert action at the end of the macro, does that appear?

I did as instructed, Typed String trigger trigger “=x=” and Insert Text by Typing action “hello”, added a sound alert at end. Tried in Terminal, TextEdit, and Mail new message. I type the "=x=" and I hear the sound, but nothing is typed, or deleted. If I type "=x=" again the second time, I don't hear the sound. I only hear the sound first time third time and every second time thereafter.

I added an alert at the end, nothing gets typed, but alert sound is played.

I'm not sure if you meant to reply to Peter or to me.

Sorry, I accidentally appended an extra quote mark to the macro's command when I exported it. I've updated the link to fix that and change the trigger to Control-Option-D.

I tested it in Terminal and iTerm on a folder with folders in it and in both cases it not only pasted the command on the command line but it returned the size of the directories in that directory.

I ran it from a Global Macro Group, as Peter suggested. Just make sure your Macro Group enables Terminal in some way.

I am trying everything both you and Peter mention. So far the macros I am trying, execute Because I get the alert but nothing is typed Into the front most window whether Mail New Message, Terminal or TextEdit.

Ken G. Brown

That makes me think the macro is not active when you're in Terminal. Which would be odd for a Global Macro Group. Sure you enabled the macro itself?

With 1) my Directory macro in the Global Macro Group and 2) the macro itself enabled (I think the default on import is to disable it) and 3) a Terminal or iTerm window active (well any application like a text editor if you have the macro in the Global Macro Group), the command should be deposited in the window.

Yes, the macro executes because I hear the Alert sound located right after the attempt to type text, whether Mail, Terminal or TextEdit windows are front most with insertion bar active ready to type in them. I see the ‘=x=‘ and hear the Alert but nothing else gets typed.

Ken G. Brown

Would you mind uploading your macro so we can see what's going on?

Here it is I think: test.kmmacros (1.7 KB)

Once I enabled it, that macro works exactly as expected here. I tried it in Terminal.

Alright then, it seems like it should work here as well but does not. I tried disabling Little Snitch, Quitting PathFinder, quitting KeyCue but nothing helped yet. I can’t think of what else might be getting in the way. I’ve also added KM in System Preferences/Privacy where it seemed appropriate.
What next?
Thx.
Ken G. Brown

Look at the Engine Log (Open Logs Folder under the Help menu of the Editor) for a clue. And try the Interactive Help on that menu, too. Good luck!

Will do. Another thing I tried was doing Record, clicked into partially hidden TextEdit window, sorta expected to see Activate textEdit first but did not. Trying explicitly doing Activate TextEdit before the Insert Text by Typing, did not help.

Ken G. Brown

Further:

Engine log shows:

2020-05-16 12:02:30 Execute macro “test” from trigger The exact case string “=x=” is typed (then deleted)

Don’t see anything other than my ‘=x=‘ typed in the TextEdit window and ‘=x=' stays there.

Ken

Seems like something is swallowing your keystrokes. Keyboard Maestro is sending them, according to the log.

Yet further:

Tried KM “test" from another admin logon that I had not used before, same symptoms.

Ken

Further:

Engine log shows:

2020-05-16 12:02:30 Execute macro “test” from trigger The exact case string “=x=” is typed (then deleted)

Don’t see anything other than my ‘=x=‘ typed in the TextEdit window and ‘=x=' stays there.

Ken