This seems to be a bug — actually two. KM Version 10.2, macOS 10.14.6. I’ve quit and restarted both the editor and the engine, no effect.
I have a large number of pieces of text (a mix of multi-paragraph passages, short snippets, and single special characters) that I assign to hot keys.
If I use Insert Text by Pasting, everything works as expected, except that I just noticed that this function actually puts its text on the system clipboard, replacing whatever is already there, before pasting. So if I had some copied text that I wanted to use after inserting the special character, it’s gone, and I get a second copy of the special character.
Solution: this function should use a non-system dedicated clipboard.
If I switch to Insert Text by Typing, it seems to work initially. But as I start to use it for other text, it behaves very weirdly: it can often take several seconds before typing anything, and then it types the wrong text — some other text that I’ve marked for Insert Text by Typing, but with a different keystroke. Sometimes it types nothing, but the second time I apply the keystroke it then types (the wrong) text. I’m not certain, but it seems to be the actions I set up earlier that have the correct text, and it’s a couple of them which show up in place of the text assigned to the later actions.
Solution: IDK. Perhaps there isn’t enough memory assigned to these actions (I have about 100) so it’s falling back on the earlier ones?
The first suggestion, to “Process Nothing”, doesn’t fix problem #2.
The second suggestion, to insert delays, isn’t relevant, because it’s not an issue with missed characters, KM is typing the completely wrong set of characters (and quite fast and correctly).
To get the behavior you expect with the first issue, simply Delete Clipboard after your Insert Text by Pasting. Some of us prefer to keep that text on the Clipboard, but that's what you do if you don't.
The second issue sounds like a conflict either with the application or other utilities or perhaps with your own macros. Take a look at Brevis, which can either paste or type your text expansion depending on the lead typed string character (not hot keys). Try a few of your expansions in Brevis and see if you experience the same behavior with pasting and typing.
At the moment I have 71 text expansion managed by Brevis, which is a single macro. So I don't think memory is an issue with Keyboard Maestro.
Re ”Delete Clipboard” — That actually works! I didn’t realize the clipboards are stacked, and the top of the stack is the “system clipboard”. So deleting that clipboard restores the previous text to the top of the stack. I would still prefer if the Insert Text by Pasting would delete that clipboard by itself, but I can live with this. Maybe in the next version they can provide a checkbox, “Restore previous clipboard”, to allow a user to easily choose the behavior they want (and help them understand what’s actually happening).
I will revert my insert texts to use pasting, thereby avoiding the second issue (in the rare case where an application won’t accept a paste, the vastly reduced number inserted by text will hopefully eliminate the issue I’m seeing).
That's never going to happen, since Keyboard Maestro already has an action for that.
If you use it all the time then create a grouped action with the paste and delete actions configured the way you like them and then turn it into a favorite.
You can also do this without having to emplace them in a group.
Correct, that is how the operation works - macOS can only Paste from the system clipboard.
Except the “it’s gone” part, because Keyboard Maestro also provides a Clipboard History which includes your past clipboards. If you want to know why Keyboard Maestro does not automatically restore the system clipboard after the action, that is documented in the wiki FAQ.
There is no non-system dedicated clipboard that can be used for pasting.
Your experience does not match anyone else, so I would guess it is related to your macros and whatever you are doing.
No. The solution is to figure out what your macros are actually doing and adjust them.
Keyboard Maestro has tens of thousands of users and zero reports of behaviour you describe, so almost certainly the behaviour you are experiencing is related either directly to your macros, or to the target application/services installed on your Mac.
I suggest you write a simple text insertion macro, and use a standard built in application (say Notes, TextEdit, Mail for example) and confirm for yourself that the macros work normally (if they don't, then your Mac definitely has some problems and that will be the next direction to look at).
Then, assuming they do work normally without issues, use the same macros but in your target application and see if you get unusual results. Then you will have something useful to start the debugging process. Or if they work, look more closely at your macros.
Whohh, don't know how it happened exactly but just ran Insert Text By Typing with a long system clipboard (13k characters). (Might've run two macros even, Insert Text By Typing with and without a 0.02 delay.) The result? Momentarily worrisome. Reminded me of an unstoppable print queue.
It ended up tabbing to an undesired field, so I used my Control Option Command K to kill all macros.... but it kept going! (noob interpretation: "oh, KM told macOS all the keys already, it's in Tim's hands now", but idk.) It's typing, opening new tabs whenever bored of typing in one too long, just unceasingly inserting in the nav bar character after character after character.
Then, in a blink, relief -- as if millions of keystrokes were suddenly silenced.
guess I have to be careful with things I don't understand who woulda thunk
--
🤠 Quick Shoutout To This Feature 🤠
Quick shoutout to this feature though... when it works where paste insertion failed, in that moment my elite hacker status is unquestionable. muah ha-ha, better luck next time ignoring my formatting, Box Notes! & That's right iPhone Mirroring, you input my clipboard and you input it good (.02 delay catalyst IIRC )! & Sorry 2FA, those four characters were four too many to type!
--
Potential Workaround: Text Chunking
Final thought, workaround potential?: Use some kinda... variable splitting to insert a large block of text by typing but only send 100-1000 characters at once, possibly requiring user input to initiate the next set of character insertion if it's hard for KM to know when the system keystroke buffer thing, if that exists, has been properly "emptied".
Yes, Keyboard Maestro will output the characters at a fixed rate (about 50 per second I believe), and then the system will queue them up, and process them at the speed the target app can handle.
You can hold all the modifiers down and click the Keyboard Maestro status menu icon to quit the Keyboard Maestro engine, and then wait for the system buffer to clear and then relaunch the Keyboard Maestro Engine.