I use Insert text by pasting action a lot as it is the fastest way to insert text I need on the screen. It has however a very annoying issue that it fills my clipboard with the pasted content which I literally never want. I can get around this by clearing the clipboard after the action every time I use it (very annoying).
Or I can use Insert text by typing action which doesn't have this problem but it unfortunately has an even bigger problem of it being much slower than Insert text by pasting.
@peternlewis Would it be possible to either make Insert text by typing as fast as Insert text by pasting (instant). Or have a global setting or something that would not fill user's clipboard with pasted text on Insert text by pasting action.
If you use MACRO: [KMFAM] Favorite Actions and Macros by @DanThomas, you can easily workaround this inconvience. Just create a Favorite Action that is both the Insert Text by Pasting AND Delete Current Clipboard.
I make great use of Dan's KMFAM system, and it works very well.
As @ccstone says - I cannot make Insert Text by Typing any faster - it operates by simulating the keys necessary to do the typing in sequence, and the application must process them in sequence, and that limits the speed at which the operation can happen. It varies from application to application, but in general it would be less that 100 characters per second, and generally quite a lot less.
Also, Insert Text by Pasting can only work by setting the System Clipboard and then pasting (simulating a ⌘V). There are no other practical ways to do this (there are other ways in limited circumstances, using either AppleScript or the accessibility API, but neither work reliably in general).
So the only remaining option is to use the Delete Current Clipboard action after the Insert Text by Pasting action. However because the ⌘V is simulated as keystroke, and because that goes in to the event queue, and the target application may take an arbitrarily long time to process it, there is no way to know how quickly you can delete the clipboard after the Insert Text by Pasting action. If you delete it too quickly, then you will end up pasting the previous clipboard instead, because the clipboard would already be deleted by the time the target application gets around to processing the ⌘V. But if you wait too long, then you may set the clipboard to something else in the mean time, and that would then be deleted, potentially leading to lost information.
I was thinking of having it as a flag setting within KM or something. But the approach of @JMichaelTX with defining a favorite action to use to paste text is good too.
Thanks for your suggestion. However you should know that it will only work if the original clipboard was only plain text. KM Variables can only store PLAIN text.
But you could use your basic logic, except use a KM Named Clipboard, which can and does store everyone that is on the System Clipboard.
So it would be:
Copy "System Clipboard" to Named Clipboard "Original Clipboard"
Insert Text by Pasting
Copy Named Clipboard "Original Clipboard" to "System Clipboard"