MACRO: Insert Text by Pasting (preserve clipboard)

I have no idea if this is valuable to anyone or not. This simple sub-macro does an Insert Text by Pasting, preserving the top entry on the clipboard. And yes, this can usually be done with two simple actions, there's an outlier situation where "Delete Past Clipboard" can fail, so this takes that into account also.

Insert Text by Pasting (preserve clipboard).v1.0.kmmacros (6.0 KB)


I have this action in a KMFAM action.


1 Like

Dan, I've never seen that. Could you please provide more details of where it fails?


That works only if the prior Clipboard is plain text.
You might want to set a Named Clipboard to the System Clipboard, instead of using a KM Variable, at the start of your macro, and then use it to restore the System Clipboard at the end.

Oh, that's a good one. Not sure I want to go through the work, though, but it's a completely valid point.

Dan, I've never seen that. Could you please provide more details of where it fails?

It fails if you've set that option I mentioned a while back, that keeps KM from using its Clipboard History. Although now that I think about it, I haven't had a problem with GIMP ever since I added it to that "exclude" list you mentioned, so maybe this isn't even relevant anymore.

It's sounding more and more like this is an unnecessary macro. What do you think? Should I just delete the topic? It doesn't matter to me...


Doesn't matter to be either. :wink:
But if you want to keep it, then I would suggest making the change to Named Clipboards that I indicated. Else some users might be surprised that the actual prior Clipboard was not retained.

Yeah, except that'll only happen if the "Delete Past Clipboard 0" action fails, so what are the odds?