Clipboard History Switcher Questions

Hi! After being inspired by the new clipboard filtering and trigger possibilities, I’ve moved from using Alfred’s clipboard history to KM’s, and seems to be paying off!

Apologies if these have been answered elsewhere, I first tried to find the answers in the forum and documentation, honest! :slight_smile:

• With “Save Clipboard History to Disk” enabled, how long does it keep clipboard entries around before deleting, and are there options somewhere for managing this?

• Is there a way to limit the size of the files retained on the clipboard to avoid it getting bogged down?

• In the spirit of keeping hands on keyboard, is there a keyboard shortcut to access the gears dropdown menu for an item without clicking?

• Feature suggestion: Allow dragging of an image from history switcher to finder folder to create a new file.
- And/or add a menu item to allow images to be saved to disk. Or is this best done by creating a clipboard filter macro with the “write to file” action?

Thanks in advance!

By default, it keeps the last 200 entries. You can adjust it via a hidden preference.

Things that "look like" passwords (ie, are concealed in the Clipboard Switcher) will not be written to disk and will be removed from the history after they get past position 10.

You can limit the size of saved clipboard flavors (hidden preference).

No. You can control click on an item. But still requires the mouse.

You can drag it as an image (or text), but not as a file.

Definitely.

It could use the Clipboard Filter trigger, the Trigger Clipboard facility, and the new Prompt For File action - practically a Perfect Storm of Keyboard Maestro 8 facilities :wink:

3 Likes

Thanks for your help once again, Peter.

I created a couple macros and decided to share just for the heck of it, in case it saves some poor newbie 10 seconds of tinkering :stuck_out_tongue_winking_eye:. Any suggestions for improvement are welcome!

Keyboard Maestro 8.0.2 “KM: Right Click on Current Clipboard History Item” Macro

  • Triggered by hotkey, just clicks on found image of the gears icon beside the currently selected clipboard item.

  • It seems that that Clipboard History window isn't identifiable within a macro since it doesn't belong to an application, so I had to make the macro global.

  • It seems to be about a 2-3 second lag before KM allows the different items in the right click menu to be selectable using the keyboard's arrow keys.

  • The 2nd action just offsets the cursor a bit to the items in the menu I'll be using most… just saves a few "down arrow" presses.

KM- Right Click on Current Clipboard History Item.kmmacros (42 KB)

Keyboard Maestro 8.0.2 “Save Clipboard as PNG” Macro

**

  • (I accidentally left "to Desktop" in the macro name because that was where I had it saving before I adjusted the macro to use the "Prompt for (New) File" action, as per Peter's recommendation)

Save Clipboard to Desktop as PNG.kmmacros (18 KB)

Save Clipboard to Desktop as PNG.kmmacros (18 KB)

Thanks for creating and posting this! I was looking for a keyboard shortcut for this too but it sounds like it doesn't exist (at least as of Oct 2017 and I haven't found any newer info).

Now in KM v9 with dark mode, the image needs to be updated but it still gets the job done. Here's a version with the dark mode icon in case anyone else is looking for this:

KM: Right Click on Current Clipboard History Item - Dark Mode.kmmacros (11.2 KB)

[Note: I used a different hot key trigger and disabled a couple of actions because I wanted the first menu item to be pre-selected. To restore it to Joel's version, disable/delete the last action (Type Down Arrow Keystroke) and re-enable the two disabled actions.]

I second the suggestion of a proper keyboard shortcut for the gear menu that works in dark or light mode without having to swap an img out.

1 Like

Another vote for the Gear Menu keyboard shortcut.

I also noticed a quirk: selecting one of the Gear Menu with the keyboard (pressing arrows keys or letters) and then aborting the operation (pressing Esc) causes the selection to jump to a different item in the clipboard list.

It looks to me like the keys are sometimes “lost” by the system when you first open that menu (same as the popup menus in the Prompt for User Input action). But they aren't really lost, they are going through to the parent window instead of the menu. Resulting in them being used to type select an entry when the menu is aborted.

I'm afraid all that event routing code is in the system, so I have no control over it. And the issue with the Prompt for User Input menus has been there for many years without a fix and without me ever figuring it out, so I would not hold your breath for a fix or resolution for this I'm afraid.

Given that, I don't know what good an action to pop open the Gear Menu would be.

Peter, with all due respect, I wonder if the problem isn't one of your own making?

Perhaps it is the window type and/or popup type you are using here and in the Prompt for User Input. KM is the only app on the Mac I've ever used where the popup does not behave properly to keystrokes.

The KM9 Clipboard History Switcher has a very rich set of options/actions, but most of them require a mouse click. It would be really helpful if you could provide shortcut keys for for the Gear Options when the CHS is displayed.

A keyboard shortcut for the gear menu allows you to keep your hands on the keyboard instead of moving to the mouse to access clipboard filters (hidden in the gear menu). Once activated the up/down arrow keys already allow selection of the desired filter in the gear menu and then Return executes it, all without ever touching the mouse (assuming you originally brought up the CHS with a shortcut key, which is the only way I ever access it).

I get all that, but it doesn't actually work. After displaying the gear menu, the arrow keys initially go in to the clipboard switcher window, rather than the menu (as I described above, this is a long standing issue with the OS for reasons I have never determined or been able to work around). These arrows will proceed to move the selection after you select the menu (the action will still apply to the specific clipboard entry, but the selection will also move), rendering the whole behaviour very suboptimal.

Keyboard nav in the gear menu works fine for me (Mojave 10.14.6). In the following screencap I never touch the mouse and trigger the gear menu using my KM macro (posted above) via keyboard shortcut:
13

I'm not arguing otherwise - but that does not provide a solution. As I said, “without me ever figuring it out”. I have no solution to this, whether it is a system bug or something related to something I am doing - either way the system controls the flow of events, and I have no access in to how it decides where to send the events in order to determine why it is not sending them to the menu system.

@khit: I'm glad it works for you, certainly it does not work for me - the first bunch of down arrows are lost. Sometimes all of them are lost. Usually the losses stop after a short while.

Actually, on my system, I have no problems with using the keyboard AFTER the Gear menu is clicked on. Perhaps there is something in your macro, maybe other macros, that is causing the problem for you Peter.

IAC, it would be most helpful if you would at least provide shortcuts for all of the tools shown on the CHS toolbar, including the Gear tool (applies to the selected CB).

Also, please provide a "Help" item in the Gear menu to shows the KM Wiki page.
This is a complex tool with lots of options. It will take a while before some of us can remember the commands we most often use.

Finally, many of us have never understood why you used such non-standard icons for Copy and Paste. What not use the standard icons?

image

thanks for considering this request.

1 Like

A post was split to a new topic: Can the Clipboard History in the status menu show images?