Shortcut for Clipboard History Switcher Filters

Hi,

I am making a transition from PasteBot to Keyboard Maestro’s clipboard manager. (“in the name of simplification” :smiley: )

I have learned about the Clipboard filters and find these extremely interesting and intriguing. The only thing I’m missing is a shortcut to bring up the list of filters / the contextual menu. Is it possible to activate the context menu with all the filters for the current item using a shortcut? If not, is this an acceptable feature request?

with much gratitude,

Alex

This might not properly address you needs but in case it helps: for text transformation, I have a group of macros, all of which use the same hotkey trigger. Each macro contains a filter action for capitalization, titlecasization (?!) etc. This results in a menu of text transformations appearing in a conflict palette.

Thanks @kevinb. Your suggestion could be an alternative solution if there’s no native way to bring the context menu up in the Clipboard History Switcher.

Let’s see what other KM experts have to say.

1 Like

You can do it with AppleScript and System Events:

tell application "System Events"
	tell process "Keyboard Maestro Engine"
		tell window "Clipboard History Switcher"
			tell item 1 of (every group of scroll area 1 of group 1 whose selected is true) to perform action "AXShowMenu"
		end tell
	end tell
end tell

So just pop that into a macro as an "Execute an AppleScript" Action, with the hot key of your choice:

Clipboard History Contextual Menu.kmmacros (2.3 KB)

2 Likes

wow. This is an incredible solution @Nige_S

The only benefit of a native solution would be the “local” shortcut.

I'm not sure what you mean -- can you expand on that a bit? There may be a solution to whatever it is.

The above solution requires registering the shortcut at top level (applicable to all applications, etc). If Keyboard Maestro would provide a native solution the shortcut assigned to showing the contextual menu would be applicable only to the Clipboard viewer window (see for example the Cmd+F which applies to the current Clipboard viewer window only).

Basically, the shortcut assigned would be restricted to specific application or even more granular to specific window.

I think (and would love to be proved wrong!) that the closest you'll get is to always run History Switcher macro and decide what to do within that. It does require an extra key stroke because of the Conflict Palette, but we can get round that by, for example:

  1. Naming the Switcher macro to start with .
  2. Adding an empty Clipboard Filter macro named .

That way you can always do hot key then . to a) run the Switcher macro when there's a conflict and b) select the . macro in the Contextual Menu when there isn't a conflict, avoiding dismissing the menu with an otherwise invalid key press.

Updated version:

Clipboard History Contextual Menu v2.kmmacros (4.5 KB)