Is There a Way to Show All Unused Key Combinations?

This would be so helpful!
I don't need to take the system key combinations into consideration.
Just the complete KM library and what is currently not assigned.
Just a thought.....
Cheers

To address the other question: which key combinations are used? I've modified @ccstone's original macro to output all macros and their shortcuts (even those without shortcuts).

Display Names and Triggers of All Keyboard Maestro Macros.kmmacros (6.8 KB)

The output goes to a window and from there you can copy it etc.

I suggest you tweak this macro until the output look the way you want it.

Hope that's helpful for you.

2 Likes

The number of key combinations is quite large. There are 15 ways to use the four standard modifier keys (command, option, control, and shift). If you restrict allowable combinations to only combinations of modifier key(s) and a single letter or number, there are 540 combinations. If you involve function keys, and non-alphanumeric keys, then it goes up from there. It's probably better to check whether a specific combination is already in use. This can be done manually by searching for the key combination in KM, or it can be done automatically by setting a key combination as a trigger and seeing whether a conflict palette is invoked.

1 Like

Or you can just list all the macros in the KM app and sort them by hot key trigger like this:

Yes, but sorting by trigger unfortunately shows only the first listed trigger for each macro. If there are multiple, they will elude detection that way.

4 Likes

Good point, @thoffman666 !

1 Like

Keep in mind that these are all macros – not just the macros available in the current context.

If you want the current context then do something like this:

tell application "Keyboard Maestro Engine"
   set macroList to gethotkeys with asstring without getall
end tell

And then parse the XML.

-Chris

2 Likes

thanx, appreciate the time and effort....
What I was hoping for is a list of hotkeys, of any key combo, yes out of the 540 combinations, that are not used for any macro.
As stated, sorting in the editor by hotkey does not show any secondary key...
Just a wish list thing....
Cheers

My prediction for the probability of that being implemented in KM is zero. But by exporting the list of used combinations, you could construct a spreadsheet that lists all possible, then filter that list by those that are NOT also listed as used.

1 Like

Yes, and the fact that secondary/additional hot keys or triggers are not listed in the Macro column either is not ideal.

One workaround is to make an Alias of the Macro and give that the new trigger. These additional triggers get listed in the Macro column and show up in a search.

image

1 Like

No kidding!  :sunglasses:

This will produce a list of the active keyboard shortcuts in the current Keyboard Maestro context.

  • The result is opened in TextEdit, although it'd be easy to change this to BBEdit.
  • No macro names are supplied.
  • No macro group names are supplied.
--------------------------------------------------------
# Auth: Christopher Stone
# dCre: 2022/01/15 19:41
# dMod: 2022/01/15 19:41 
# Appl: Keyboard Maestro, TextEdit
# Task: Parse Current Keyboard Maestro Context for Hotkey Trigger Values.
#     : Open the result in TextEdit.
# Libs: None
# Osax: None
# Tags: @Applescript, @Script, @Keyboard_Maestro_Engine, @TextEdit, @Parse, @Hotkey
# Vers: 1.00
--------------------------------------------------------

tell application "Keyboard Maestro Engine"
   set macroList to gethotkeys with asstring without getall
end tell

set shCmdStr to "
export PATH=/opt/local/bin:/opt/local/sbin:/usr/local/bin:$PATH;
echo " & quoted form of macroList & " \\
| sed -En '/[	]{3,}<key>key<\\/key>/,/<string>.+<\\/string>/{
   /<key>key<\\/key>/d
   s!</?string>!!g
   s!^	+!!g
   p;
}
' \\
| sort -h \\
| open -f
"

do shell script shCmdStr

tell application "TextEdit"
   
   repeat until exists of front document
      delay 0.25
   end repeat
   
   tell text of front document
      set font to "Times"
      set size to 16
   end tell
   
end tell

--------------------------------------------------------

That's about as far as I'm willing to fool with this task, although I'll answer questions.

-Chris

4 Likes

Woof!, I know the 'proper' forum etiquette would be to simply 'like' your solution @ccstone , but I can't help but say thank.
As always, thank you for your generosity on this forum...
I for one am very grateful...
Have a nice Sunday.

Note: Please don't spend more time on this, not necessary...
First notice is that it is not 'reporting' any F2, F3, F5 or F6 triggers, of which there are many... at that point I stopped comparing.
I had the 'all macros' set active and chosen at the time of running.

Hey @troy,

This doesn't work on selected macros – it works on macros that are active in the current context.

  • If Google Chrome is frontmost – what macros are available.
  • If the Finder is frontmost – what macros are available.

This is essentially the same list you'll get from the Trigger Macro by Name action.

-Chris

1 Like

ah, my complete bad man....
so there is not a way to perform that script on all macros, or the global macros?
cheers,

@tiffle's script does that.

But knowing all hotkeys used doesn't help you with the current context.

You may have used F1 in your Finder macro group, but it's still available as a trigger for your Google Chrome macro group.

Does that help clarify things?

1 Like

ah, I'm working on getting my head around it... =) - making more sense...

  • but there is no way to show the global or all macro set results as an option?
    cheers...

1 Like

Or – in a rather rude but simple way – you can just evoke this key combination and watch if anything is happening.

If not – it's free!

2 Likes