Keyboard Shortcut for Creating a new Desktop (new Space) on MacOS

Found a solution with apple script here, credit to @codehearts: https://github.com/ianyh/Amethyst/issues/143

tell application "System Events"
  do shell script "/Applications/Mission\\ Control.app/Contents/MacOS/Mission\\ Control"
  click button 1 of group "Spaces Bar" of group 1 of group "Mission Control" of process "Dock"
  do shell script "/Applications/Mission\\ Control.app/Contents/MacOS/Mission\\ Control"
end tell

The script can be either saved as a ...applescript file with #!/usr/bin/osascript line to run in the shell, or bind to a key directly in Alfred to start a new desktop through Mission Control.


I'm not sure there are any native solution to this problem, but there are third-party applications that can help.

One of them is BetterTouchTool, a program that can aid operating a Mac in several ways.

Another is Hammerspoon, but that requires you to write some code yourself.

I doubt these are the only two, only the two I know of.