Question: I cannot for the life of me figure this out. I have two monitors. If I'm focused on the left monitor, I cannot use a shortcut to switch spaces on the right monitor. Or (as often happens) I click my right monitor to focus it instead of alt tabbing, and then I cannot switch the left monitor space with my keyboard without clicking on that screen.

Is there not a way to control the space of another monitor with your keyboard?

Answer: 
Yes, if you know applescript.

For example, to switch to **Space 1** on the **Secondary Display**. Note: 

1) Primary/Secondary Display is defined by where the Menu Bar is (i.e. System Preference -> Display -> Arrangement), not by cursor focus.

2) This script switches to *Space 1*, whether it's a Desktop or fullscreen app. If you want to switch *only* to Desktop 1, it can be done, but not with this script as it is.

3) If you don't mind flashing, remove `delay 0.5` line.

4) The script cannot do without the animation/transition.

5) Enable Accessibility and all the standard applescript spiel. 

6) Modify button number to switch to a different Space on that Display. Modify list number to switch a different Display.

7) Switching to a non-existent Space, e.g. Space 100, would leave the UI at mission control. Nothing bad is going in bad to your computer. It just stays there, and user will have to manually drop back to current Space.

8) No relative switching, i.e. move left or right a space. Just absolute switching.

9) Cursor focus doesn't switch display after running this script. That's a plus.

10) No simultaneously switching Spaces on both displays.

```
tell application "System Events"

    do shell script "/Applications/Mission\\ Control.app/Contents/MacOS/Mission\\ Control"
    delay 0.5
    tell process "Dock" to tell group 1 to tell list 2 to tell button 1 to click

end tell

```
The free app "CurrentKey Stats" will do just what you want: `https://currentkey.com/`

With CKS, you can assign a hotkey to each Desktop/Workspace. Pressing that hotkey will bring up the assigned space no matter which monitor has the mouse or has the active focus. You can be working in the main monitor and press your chosen hotkey to change which desktop is visible in the side monitor, without losing focus in the main monitor or having to move the mouse.

CKS has the powerful feature of being able to assign names to each desktop workspace -- and (here's the cool part) the names *persist* if you change the *order* of your desktop spaces, even if you move them to another monitor. That seriously beats the Mission Control names of Desktop 1, Desktop 2, etc., especially if you like to rearrange the order to put things you're working on at the same time into adjacent workspaces.

I currently have 21 desktop spaces and I was running out of mnemonic hotkeys that I could type one-handed and didn't have side effects in one app or another, so I created a menu in "Keyboard Maestro". Other apps like QuickKeys or Alfred can probably do the same kind of thing.

In my KBM menu, I type a hotkey, Shift+Option+Command+S, that I can do with my left hand and it brings up a menu listing the names of all the desktop workspaces. A second keystroke, this time without any modifiers, picks from the menu. (Actually, the menu items can say whatever I want, I use the CKS name preceded by the menu choice mnemonic letter.)

My primary reason for making sure that I can access my Spaces menu (Shift+Option+Command+S) and the menu choices one-handed is that if you change desktop workspace while in the middle of dragging a window, you drag that window to the new workspace.