Change keyboard shortcuts inside Preferences > Keyboard > Shortcuts

Inside Preferences > Keyboard > Shortcuts I have this shortcut (the last one that uses ALT+TAB):
image

Is this possible to achieve using KM only?
The reason I would like to do this is because if I have to reinstall macOS, I would like to just install KM and that shortcut would be there so I don't have to go to Preferences > Keyboard > Shortcuts to configure it.

The same for this one that I had to add, because I don't like using CMD+R to Record inside KM, instead I like to use CMD+R to rename an action:
image

And then if I can also add these:
image

I know that some of these are different when macOS is installed, so I don't want to even think about it. Everything would be ready once I installed KM.

With the first as an example...

Set it back to the default keystroke ⌘`, and set up a globally available KM macro like this:

This workaround would still have the original shortcut available, which is not intended, because I may want to use that shortcut (for example CMD+~) for something else.
The same applies to the other shortcuts. I would like to replace them completely, which is what the System Preferences does.

Also, for KM and the Record shortcut, even if I assign a new shortcut, CMD+R will still be there to record, so this wouldn't work.

A quick forum search threw this up:

I was looking at that thread and it doesn't show anything related to what I am looking for.
If you are talking about using the "Select or Show a menu item", that does the exact same thing as using the keystroke. The original shortcut will still be there (CMD+R), the only difference is that you add another one.
When you use System Preferences, the actual shortcut inside the app changes, so you're not adding a 2nd shortcut, you are replacing the existing one.

Other than a super long thread of people trying to explain how things should be presented on the KM Wiki page, etc, I didn't see a solution for this?

Also, even if that was a solution, it doesn't solve the issue with the other 2:

  • Change the focus window
  • Change the screenshot shortcuts

I am looking for something deeper than that. Maybe it's not even possible, which I understand. KM doesn't have to do everything, but so far those 2 options you presented, would not work for what I am looking for. I guess I will just have to keep taking notes of what I change.

Thanks anyway :slight_smile:

Ok my bad. I saw that he was asking the same question as you, but I didn't realise the thread evolved into a more general discussion with no explicit answer to the initial query.

To make up for it:

https://hints.macworld.com/article.php?story=20131123074223584

Thank you for sharing that link.
As I mentioned before, the Terminal and the whole shell scripting world is foreign to me, but I got this:

defaults write com.stairways.keyboardmaestro.editor NSUserKeyEquivalents -dict-add "Record" -string "@$~^z"

I found that "com.stairways.keyboardmaestro.editor" here:
/Users/dannywyatt/Library/WebKit/com.stairways.keyboardmaestro.editor

Can you confirm if this is the right location and file and if the line of code is correct?
I just tried it and when I look at the menu, it's still CMD+R and when I press that shortcut (Shift+Control+Alt+Cmd+Z) nothing happens. And yes, I restarted the app as suggested by the person on that article :wink:

But even if that ends up working, how will that be applied to the Windows Focus and the Screenshots? Those don't have an "app" or a "menu item" associated with them. I saw the system-wide code, but for those 2 options, there's no "menu item" associated. Or maybe they do and I have no idea how to get to them...

But yeah, that line didn't change anything. Can you confirm if that's the right way to do it?

I even tried using the app's name (Keyboard Maestro), but that one showed me an error, whereas the first one didn't:

I don't know but I reckon I know someone who might.

I have to say though, this seems like a lot of fuss for something you'll do once in a blue moon and takes 30sec. Just saying.

(@Nige_S)

I agree and it’s not something I would want anyone to spend too much time researching. At least not for my particular case, maybe for others with dozens of them it would be different.
My thing is: if it was possible and easy, then I would have everything in one place which is what I like doing. That’s all.

1 Like

I think you would need to run something like this as a shell script:

defaults write -g NSUserKeyEquivalents -dict-add "Move focus to next window" -string "~<Tab>"

...but I'm not sure how to represent the ⇥ key.

Honestly -- I'd leave them in System Prefs whenever possible. These are user preferences (make another account on your Mac, switch to that, and you'll see your changes haven't carried over) and will be maintained if you clean-install your OS, migrate your home folder to a new machine, or erase/reinstall from Time Machine.

If you don't use Migration Assistant or Time Machine in those situations you'll have way more things to reset than a few keyboard shortcuts!

1 Like

Keyboard Maestro is great but I don't think it can replace everything.

I too like to set as many hotkeys as possible using Keyboard Maestro especially as Keyboard Maestro syncs across my Macs. If possible I will always set the hotkey for an App via Keyboard Maestro rather than through the app itself. But there are some things that are simpler to just set in System Preferences. Not just hotkeys but also options on scrolling, aways showing file extensions, enabling right click (amazing that that one still has to be set) etc etc. And not all of these things are in System Preferences (some are in the Finder view options menu).

In my case I have a cheat sheet document where I try to stay up to date with what settings I like to set on a new Mac on new install. I might be a little sad but I actually enjoy working my way through it on a new Mac. Maybe something to do with feeling I am working even though I am just working my way down a list... :rofl: