As always after spending a minute to investigate, solution found.
Set variable to %PastClipboard%0%, paste the variable then delete past clipboard 0. nice
When I
"Set the system clipboard to Past Clipboard 1" and then paste.
It is pasting the 2nd clipboard, not the first.
The goal is to paste clipboard 1 and also have it stay in position 1.
Appreciate any help.
I did see a few posts but nothing addressed my issue.
thanx man, I did see a post with that Set/Paste/Set but that does not work , it changes the order of the history.
I found the %PastClipboard%0% then paste then delete past clipboard 0, retains the past history order.
Well, it does work in the sense that the clipboard with "Two" was in position 2 both before and after the macro.
But I see the problem. You original clipboards were created by copying a rich text source. So, when KM converted them to plain text to paste, it now sees them as being different in content.
You method of Delete past clipboard 0 only works if the original items were rich text. When I try your method, I get:
So, the second item, which was "Four", has been lost.
Looks like this is a tricky problem. I don't see an obvious solution.
There seems to be something going on depending if it is rich text or not -
I just tested with 'plain text' and the result is different than with rich text.
Should they not respond the same way? rich or plain, that makes it difficult to create an across the board solution.
For Rich Text
Here are macros pasting clipboard history 1 thru 4 (individual macros - 4 of them)
the before and after history stay the same which is my goal
So, we have to test the contents of %PastClipboard%1% to see if it is rich text or not.
This macro seems to work with both rich text and plain text in the CB History. Test it to see if it works for you.
MACRO: Test Paste Past Clipboard
#### DOWNLOAD:
<a class="attachment" href="/uploads/default/original/3X/3/0/304a83da8aabb8cad84a0fb9b51d892566914828.kmmacros">Test Paste Past Clipboard.kmmacros</a> (3.6 KB)
**Note: This Macro was uploaded in a DISABLED state. You must enable before it can be triggered.**
---

This works for rich or plain text but, it is pasting clipboard 2 not 1 in both cases. And cannot set the first step to clipboard 0, probably with a variable it will work.
Ah- but a variable does not keep formatting.
And why when you paste a past clipboard history, does it change the order to the clipboard history? Nothing new has been copied. I would think it would only change when something was copied.
It only changes when a macro uses the action to paste a past clipboard.
If you use command v to paste something the history does not change.
oh boy, as always, thank you for your patience, expertise, and explanation.
I of course was using the numbers in the history switcher pane, NOT the past clipboard # as you have explained it.
I will work with this and hopefully come up with a solution that works for rtf and plain, probably the solution you provided earlier will be perfect, I'll have to keep in mind that the most recently copied data is 0, =ing the clipboard.
No, it does not work.
It works for past clipboard 1 but not 2 and higher.
I'd like to have a set of keys - 1 thru 10 (with whatever modifier)
that will paste either plain or rich text from past clipboards.
ie
โงโ1 will do a simple paste since that is the current system clipboard
โงโ2 will paste what is in the past clipboard #1 and not change the order regardless of rich or plain text
โงโ3 will paste what is in the past clipboard #2 and not change the order regardless of rich or plain text
โงโ4 will paste what is in the past clipboard #3 and not change the order regardless of rich or plain text
etc etc -
I think you are trying to use the Clipboard History in a way that was never intended, or thought of. It may be possible, but I think it would be a lot of work.
I think you would be better of with using Global Variables or a Dictionary with plain text data, and Named Clipboards for rich text/images/objects.
@JMichaelTX You are correct, my understanding of this tool is not good.
For my education, would you mind giving me an example of how you might use the Clipboard History Swither? I'm sure that would help me immensely.
What I have been using for quite awhile is a conflict palette for storing/recalling data with clipboards. I frequently have 4, 5 or more numbers/text that I want to recall in the near future but not always in a certain order or within a definite time frame. This has worked well for me. Just sharing. -
โKey Pad 1 is for storing - followed by any number 1-9 will store in the corresponding clipboard
โKey Pad 2 is for recalling - followed by any number 1-9 will recall from the corresponding clipboard
You can then paste any previous system clipboard by triggering the Clipboard History Switcher macro. Clipboard History Switcher will present you with a window allowing you to select any of the past clipboard and paste them.
So I use it visually most of the time: (1) Display the Switcher; (2) Double-click on the Clipboard I want to paste.
I've not really used the Favorites or Search feature, but they might be of interest to you.
You can mark entries as favorites, in which case they will never be removed from the clipboard history. You can toggle a filter to show only the favorites in the search field (top right), or by option clicking on the favorites button.
You can use the search field to filter the clipboards.
Have just now carefully read through the Wiki on Clipboard History Switcher I realize that it probably has functions/features that I could use, but have not do so.
Set System Clipboard to plain text โ%PastClipboard%1โ
In particular, the latter is likely to add an entry to the clipboard history, since the plain text clipboard is different to the original clipboard entry, which probably had some amount of styling or other information associated with it (unless it was created as a plain text clipboard with the same text by Keyboard Maestro).
So you really should just need to do this
Set System Clipboard to past clipboard 1
Paste
Set System Clipboard to past clipboard 1
There may be issues where that fails due to clipboard caching or the asynchronous nature of clipboard handling and keyboard event queues (the Command-V for the Paste), but it should work in general, and result in the clipboard history being unchanged from before the macro.
Peter, you changed two things between the statements, and never used the correct syntax for %PastClipboard%1%. So the intent of your statement is unclear.
Maybe you were using different Actions, but it is not clear.
I think we figured out that using past clipboard 1 would work, but what about using another past clipboard, say #3? Would that keep past clipboard 3 in the same order on the Clipboard history?
โSet System Clipboard to past clipboard 3โ would take past clipboard 3 (ie the one that is fourth in the list of the clipboard history), and move it to the front of the clipboard history into the system clipboard.
A lot of work and complication just to maintain original clipboard order.
Would you entertain an enhancement request to Paste from Past Clipbboard # and make no changes to History?