Mission Control Desktop Spaces, a.k.a. Desktop Spaces, a.k.a. macOS virtual Desktops, can be very useful particularly when using a MacBook. Unfortunately, however, configuration and use of Desktop Spaces can be confusing especially when using three or more. The current macOS maximum is 16.
In addition, native macOS does not provide:
A visual indication of the Desktop number. Moreover, macOS does not include a public API to determine the Desktop number or to switch Desktop Spaces.
A quick method to switch between non-adjacent Desktops.
An efficient method to move windows to non-adjacent Desktops
The instruction and macros in this post will address these shortcomings and more.
This set of macro has two requirements:
Keyboard Maestro v10+ (because macro subroutines are used)
WhichSpace (a free, third-party menubar application)
This set of macros supersedes all macros found in forum thread Desktop Spaces • Macros for Navigation and Window Management.
Expand for details
The macros will be installed in macro group: .sys Desktop Spaces. The group can be renamed, but it is recommended that the macro be kept together.
The group consists of 57 macros:
8 Primary Macros—4 for navigation and 4 for window movement:
- Go Left a Desktop
- Go Right a Desktop
- Go to Application Desktop
- Go to Previous Desktop
- Move Application Window to Current Desktop
- Move Window Left a Desktop
- Move Window Right a Desktop
- Move Window to Previous Desktop
7 Subroutine Macros:
- sub—Activate an App and Wait Until It Is Ready
- sub—Get DesktopNo
- sub—Get DesktopNo_prev
- sub—Go to Desktop N
- sub—Move Window to Desktop N
- sub—Put DesktopNo and/or DesktopNo_prev
- sub—Type Keystroke for Switch to Desktop N
42 Conflict Palette Macros
Due to the modular design:
The macros have been simplified.
The 8 primary macros and 7 subroutine macros can easily be used by other macros in the Keyboard Maestro library. Also, macro hot keys and underlying macOS keyboard shortcuts can now be easily changed (if the default configuration causes collisions with existing library macro hot keys and/or macOS keyboard shortcuts).
If you previously installed any macros from Keyboard Maestro thread Desktop Spaces • Macros for Navigation and Window Management, complete the following:
If it exists, disable the .sys Spaces macro group. Rename it .sys Spaces-superseded.
If it exists, disable the .sys Desktops macro group. Rename it .sys Desktops-superseded.
Afer completing the installation steps below, optionally come back and delete these two disabled macro groups and all macros within.
macro: Go to Previous Desktop
Bug fix: local_dnPreviouslySaved was improperly determined.
macro: Move Window to Previous Desktop
Removed an extraneous local_dnTarget Set Variable to Text action. No change to macro functionality.
macro: sub—Activate an App and Wait Until It Is Ready
Added provision for applications that have a null %FrontWindowName%.
To install Desktop Spaces • Macros to Improve Navigation and Window Management, complete the following:
If necessary, using Mission Control, create multiple macOS Desktop Spaces.
Configure System Preferences > Mission Control.
Configure System Preferences > Keyboard > Shortcuts > Mission Control.
Switch to Desktop 1 .. 9 ⌃⌥⌘1 .. ⌃⌥⌘9 Switch to Desktop 10 .. 16 ⌃⌥⇧⌘0 .. ⌃⌥⇧⌘6
Click to download the following:
Unzip the download and follow the instructions included in the enclosed _READ ME FIRST_ files.