Clipboard history switcher pasting numbers 1-9

hi, i'm trying to make a macro that will call up the clipboard history switcher, then while referencing it i can type 1-9 to selectively paste in something from a past clipboard. i've attached a screenshot of what i've tried so far, but i'm clearly out of my league on this lol! any help will be appreciated. thanks! -todd

i guess no one has a thought on my question here?...
https://forum.keyboardmaestro.com/t/clipboard-history-switcher-pasting-numbers-1-9/16090
maybe it would be too complicated? if i don't hear back i'll just give up and click my mouse to paste from the clipboard history :slight_smile:

  • todd

Please don't cross-post or double-post. I have moved your double-post to your original topic.

Please be patient. Lots of help is offered in this forum, but the members generally don't post if they don't have something to offer.

Having said that, to paste from a prior clipboard, you might try something like this:

image

However, as soon as you run this Macro, the Clipboard History is NO LONGER in the same order as it was.

So, I'm not sure that is really what you want.

If you want to consistently paste a specific Clipboard, then you should use Named Clipboards

You may also be interested in the Macro:

MACRO: Paste In Order Copied

1 Like

sorry for the transgression and thanks for the "paste in order copied" macro set – i seriously LOVE them! ...

also, thanks for your input on my macro attempt, i tried it as a start but couldn't get what i was thinking to work... i don't mind if the clipboard history is no longer in the same order, i was just thinking it could come in handy to type a hotkey, then while looking at the clipboard history for reference i could then type 1-9 to paste from something i copied to the clipboard in the recent past. any thoughts on how to pull that off? or does the macro you showed me here do that and i'm just implementing it wrong? thanks! -todd

1 Like

The macro I gave you should work, maybe with one minor adjustment:

image

The clipboards are actually numbered starting at 0, but for some unknown reason the Clipboard History shows numbers starting at 1:

image

So, when viewing the Clipboard History, to paste the one labeled "3", we need to subtract 1 from that when we set the System Clipboard to a Past Clipboard.

So, you end up with this, which should do what you want:

MACRO:   Paste From Clipboard History [Example]

**Requires: KM 8.2.4+   macOS 10.11 (El Capitan)+**
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

#### DOWNLOAD Macro File:
<a class="attachment" href="/uploads/default/original/3X/a/6/a6367b0db6d7ca716ae3b2be4cf76e009fd7ad14.kmmacros">Paste From  Clipboard History [Example].kmmacros</a>
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**


---


<img src="/uploads/default/original/3X/a/f/af08084164aaa1e24ebfe428c854e59edc5bce64.png" width="541" height="702">
1 Like

thank you!... but... i tried this and i can only get it to paste the first numbered clipboard no matter what number key i type, i must be doing something wrong... i even tried adding more variables (2, 3...) but i have no idea what i'm doing... a screenshot is attached of what i have so far (i tried it before adding the first "activate clipboard history switcher" action). thanks, -todd

1 Like

I'm not sure exactly why this is myself, but I ran into the same issue when recreating this macro and found that adding a "Delete current system clipboard" action at the end fixed it:

1 Like

That is indeed strange behavior. Turns out that if the Clipboard History Switcher has focus the the Paste Action is executed, it pastes the wrong Clipboard.

@peternlewis, any idea why? Is this a bug?

IAC, I found that by closing the CHS the macro behaves as expected.
I don't want to Delete the Clipboard, because I might need it again.

MACRO:   Paste From Clipboard History [Example]

**Requires: KM 8.2.4+&nbsp;&nbsp;&nbsp;macOS 10.11 (El Capitan)+**
(Macro was written & tested using KM 9.0+ on macOS 10.14.5 (Mojave))

#### DOWNLOAD Macro File:
<a class="attachment" href="/uploads/default/original/3X/4/9/49196c27f9dd14ff3ce27cda724c06f0a388e218.kmmacros">Paste From  Clipboard History [Example].kmmacros</a>
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**


---


<img src="/uploads/default/original/3X/a/2/a2ecad858af460c6618e7def75a9c36bcdeef07c.png" width="541" height="864">
2 Likes

The Paste action, is just a ⌘V, and ⌘V in the Clipboard History Switcher pastes the selected item in.

Peter, I think perhaps you missed the point/issue that all of us observed in my first macro that set the System Clipboard to a prior clipboard, and then did a paste WHILE the Clipboard History Switcher was open. It pastes the wrong clipboard.

It is irrelevant what the system clipboard is set to. If the Clipboard History Switcher is focussed, then ⌘V will paste the selected entry, and it does not matter wether you type the ⌘V or Keyboard Maestro does via the Paste action or Insert Text by Pasting action or whatever.

So unless you are saying something other than the selected Clipboard History Switcher entry is being pasted, it is behaving as designed.

1 Like

OK, thanks for the clarification. That explains the behavior in my first macro.
My second macro closes the Clipboard History Switcher BEFORE doing the Paste, so it works fine (as expected)

1 Like

it worked! thank you everyone! -todd

1 Like