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?
Keyboard Maestro does not restore the system clipboard, not after this case, nor any other case where it pastes (eg with the Insert Text by Pasting action) because to do so invites problems. Either the clipboard is restored too quickly, and the original system clipboard is pasted instead of the desired one, or the clipboard is restored too slowly and something else has replaced it and is then overwritten.
Yes, it would be nice to be able to paste from something other than the system clipboard, but macOS does not support that concept.
Curious statement. If we can write a macro to do this, why can't you do it internal to KM? After all, you have direct control over everything except what is on the System clipboard.
That is doable, although it would break one of the rules about the clipboard history, that duplicate entries are removed. Admittedly, this rule has caused problems when trying to manipulate the clipboard on occasion, and it's not clear that it adds a whole lot of value (although clearly if you open the clipboard history and instead of seeing ten things you end up just seeing a pair of things multiple times that is a case where the rule adds value).
Right, but that is the exact point, and the user would be well aware of this when using this new paste action Paste from PastClipboard & Keep. Of course, with the use case we are discussing here, the duplicate would be quickly removed by the user's macro action Delete PastClipboard 0
Yes, I understand that. Internally, it would make no difference, I could keep references to the two clipboards.
But I do wonder whether it would end up with the history being cluttered up by many duplicates of the same thing. For example, I know when I am programming and moving things around, I will often copy the same variable name multiple times, and to have that scattered through the history would seem less than useful for the normal use of the clipboard history switcher for example.
I'm not sure how to best resolve these two conflicting use cases.