Paste From Sequential Queue

This seems duable to but wanted to run it by people. I want to stop using PasteBot and just build in using the HTML windows that @DanThomas posted to see a small window of content in the clipboard and then copy sequentially once I open/run the pallet/macro and then use command C to add to the window with a number next to each thing copied.

When I press command+v as long as the window is open then I will paste in order that the items were copied so the first item coped would be pasted and it would disaper from the window and the next item would then be shown.

Something like this is what I am thinking.

Step 1: Create the Toggle Macro for the Sequential Clipboard

  1. Create a New Macro in Keyboard Maestro, naming it something like “Toggle Sequential Clipboard.”
  2. Set the Trigger: Assign a hotkey trigger (e.g., ⌘ + Shift + C) to toggle the clipboard display window on and off.

Step 2: Set Up a Clipboard Array Variable and Initialize It

  1. Add an Action to Check if the Clipboard Window is Open:
  • Use an “If Then Else” action at the start of the macro.
  • Check if a variable, say ClipboardWindowOpen, exists and is set to 1 (indicating that the window is open).
  1. If the Window is Open:
  • Add actions to close the HTML clipboard window and clear the clipboard array if needed.
  • Set ClipboardWindowOpen to 0 to indicate the window is now closed.
  1. If the Window is Not Open:
  • Set ClipboardWindowOpen to 1 to indicate the window is open.
  • Initialize or clear a variable called ClipboardArray to hold the clipboard contents.
  • Show the HTML window that will dynamically update with each new clipboard item.

Step 3: Create a Macro to Capture Each New Clipboard Item

  1. Set Up the Clipboard Listener Macro:
  • Create a new macro, triggered by Command + C, to capture each new clipboard item.
  • This macro should:
    • Get the current clipboard contents.
    • Add the contents to the ClipboardArray variable (either appending to a comma-separated list or as JSON).
    • Refresh the HTML display window to reflect the updated clipboard list.
  1. Add Condition to Only Trigger When the Window is Open:
  • To make sure this macro only activates when the sequential clipboard is active, add a condition to check if ClipboardWindowOpen is set to 1.

Step 4: Create the HTML Clipboard Display Window

  1. Customize an HTML Window:
  • Use a “Custom HTML Prompt” action to create a small HTML window that displays the clipboard items in sequence.
  • Format the HTML window with JavaScript to update dynamically whenever the ClipboardArray variable is modified.
  • Each item should appear with a number in the order it was copied.
  1. Auto-Refresh the Window:
  • Use JavaScript in the HTML to refresh the display every time ClipboardArray updates.

Step 5: Create the Sequential Paste Macro

  1. Create the Paste Macro (Command + V):
  • This macro should paste the first item in ClipboardArray, remove it from the list, and refresh the HTML window.
  • If there are no items in the array, the macro should show a message like “No items to paste.”

Putting It All Together

  1. Toggle Macro (⌘ + Shift + C): Starts or stops the sequential clipboard, opening/closing the HTML window.
  2. Copy Macro (Command + C): Captures each new clipboard item, adds it to ClipboardArray, and updates the HTML display.
  3. Paste Macro (Command + V): Pastes the first item in the list, removes it from the ClipboardArray, and updates the display window.

This setup will allow you to activate a sequential clipboard when needed, with a growing list shown in a dynamic HTML window. Pressing the toggle key will close everything, ready to start fresh next time.

What I don't know is reading and trying to understand Clipboard Flavors (which seems a bit vague from the Wiki and what I can find) it might not keep things that would properly paste back into things like MS Excel, or Keyboard Maestro actions copied etc. I mostly want it to be text but would like to make it more bullet proof as I work on this.

PasteBot - Paste From Sequential Queue

I don't know why it does this but the extra six came when I selected all and deleted everything. I guess that puts things into the cue for the last copied item for some reason in PasteBot. Anyway hopefully the GIF gives you a clear idea of what I am trying to do with Keyboard Maestro. That way I don't have to install as many applications to get the features I want and can also exclude such things from some applications like Keyboard Maestro allows you to do.

I didn't read your whole post, put can't you do this using KM's Clipboard? The only issue is that you need to add them in the reverse order of how you want to paste them, but then all you need is a simple macro that pastes the current clipboard, then deletes the current clipboard.

Okay great, thanks I will see what I can figure out. I didn't want to make it overly complicated because I knew I would spend hours on this and then find out there was a much simpler way.

What are you talking about? Doesn't everyone do that? I know I do! :joy:

3 Likes

Not quite as nice with the window that shows thing disapeer from the clipboard history but you can use these two macros to paste the past clipboard history in sequential order.

Clpboard History Macros (v11.0.3)

Clpboard History Macros.kmmacros (38 KB)

Keyboard Maestro Export

In order to see what PasteBot does I installed it yesterday from the Mac App Store. I've seen it mentioned a few time now so, I was curious.

Its sequential paste is really nice and clean. And it has a few other features that I like so, I'm going to go the opposite way and see if it works for me as my clipboard manager.

Whilst I think it would be possible to clone the sequential paste feature up to a point in Keyboard Maestro I don't really see the point when PasteBot does it anyway and is a one-time-purchase, reasonably priced App.

On the one hand I don't want to have too many helper apps on my Mac but on the other hand sometimes it is better just to accept that a dedicated little app will be smoother than something I might build myself in Keyboard Maestro. Another example is the App Hazel. Keyboard Maestro can sort of replicate Hazel but I'd rather use Hazel for what Hazel does best. Just my Two Cents :grinning:

I share all your centiments here. For me the biggest reason for building it into Keyboard Maestro is because when I go to new work places trying to get approved a dozen apps I use is more difficult and feels like more favors then just getting one app approved that I can tweak and has everything I need with windows resizing, clipboard, and many other things.

I love Hazel and have worked back and forth with the developer on some great features he has implemented over the years. It does what it does really well and the remove all releated items when I trash an app has been wonderful and not needing to use yet another app like AppZapper or the like. I agree with your two cents. :slightly_smiling_face:

1 Like

Ah. That makes sense. In the meantime I have been enjoying using PasteBot. It has a simple clean interface and does help with using the clipboard. I especially like that it syncs via iCloud.

1 Like