I want to configure a global keyboard shortcut in MacOS using a script.

Specifically, I want to set the "Move focus to next window" to ⌘⇧§ (since I have a Swedish keyboard and the default ⌘⇧` has a tendency to insert backquotes all over the place)

So I want the setting to end up like this Keyboard shortcuts with "Move focus to next window" focused

I have tried this command

defaults write -g NSUserKeyEquivalents '{ "Move focus to next window"="@§"; }'

Inspired by this and this instruction. But it does not work.

  • I don't quite understand why you won't just double-click "Cmd-§" at the right of your highlighted line and input your desired shortcut ?!? Doesn't this work with you? Oh, sorry, just noticed you want to have a script doing this for you. Oct 7, 2018 at 17:02
  • 1
    Great question. That said, it can be helpful to be more specific when saying something doesn’t work: itdidnt.work
    – Alan H.
    Mar 22, 2022 at 21:11
  • 1
    @AlanH. Good point. It simply did nothing at all, no shortcut was changed. Mar 22, 2022 at 21:34

1 Answer 1


Well, if you want to set the "Move focus to next window" to ⌘ ⇧ § you'll obviously also need two modifiers along with the § key. (Your screenshot is contradictory to this, though.)

Your script has to contain an additional "$" here: '{"Move focus to next window"="@$§";}'.
Maybe this will work?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .