Starting With Mission Control and Spaces

Hi,

I'm curious if there is a good way using keyboard maestro to Manage Mission Control and Spaces?

For a simple starter, I would like to be able create a new space in mission control.

to start mission control - I tried a simple macro:

type keystroke: control up arrow
but nothing happened...
then I image next might be
type keystroke: plus sign?

Thanks for your help in advance - Dave

1 Like

Have you read this long thread?

1 Like

Thanks Sleepy - I will now.

Hi @dealtek. I'm the one who shared Desktop Spaces • Macros for Navigation and Window Management.

My macros are not designed to manage Desktop Spaces; they are really to use them more efficiently.

During the development of those macros I did learn a lot about Desktop Spaces and I tried to share all of the important information within that post. So even if the macros don't meet you needs, you might find that information helpful.

With that said, if, after reading the information on that post, you have any questions feel free to ask here our within the thread.

Not with my macros. With them, it's assumed the Desktop Spaces are already created.

I don't think there is any scriptable way to create a new Space, at least I haven't found one. AppleScript can't do it, Shortcuts can't do it. There is no way to assign a hot key to creating a new Space in the keyboard shortcuts preferences.

You can do "Activate Specific Activation" and open Mission Control, that brings the view up with all the Spaces where you click the + sign on the right to create a Space, but once that view is open Keyboard Maestro mouse click events don't seem to work.

I found a thread about this topic on another website:

Thanks every body for the help. I am making progress with this.

Using Monterey 12.2.1

First I just learned that I can create an extra space and it will remain even past reboots. Nice.

So I have a I have a macbook and external monitor. (Desktop 1 and 2). I created a new space (Desktop 3).

The basic idea is to have desktop 1 and 2 used for daily work and the desktop 3 be used for non work like social media apps etc.

So I have a KM Macro that opens several finder windows and Apps for daily work on desktop 1 and 2.

New - then I added a new macro that types types CTR shift 3 (my key mods) to go to the new Desktop 3 and open other apps in this window.

All works great.

Currently, when I use "command – tab" to jump to various applications, when I choose an application that is in the new desktop space 3, I was thinking it should automatically jump to that Desktop space and activate the application but it does not. Also if I am in space 3 and choose an app in space 1 or 2 it does NOT jump either.

Q: Is there a way I can get the Mac to automatically jump do the application (CMD-TAB) no matter what desktop space it is in?

Hi @dealtek.

Yes, using the System Preferences > Mission Control. You'll find that information (in a screenshot) and other useful Mission Control Desktop Spaces information here: Desktop Spaces • Macros for Navigation and Window Management

Thanks very much _jims.

With your links I found it here:

mission Control prefs...

When switching to an application, switch to a space with open windows for this application.

1 Like

Keyboard Maestro is awesome, but space management is a challenging task. I looked into Yabai first, but I wasn't crazy about the requirement to disable SIP. Fortunately, Hammerspoon is capable of adding/removing spaces. I posted a simple example on Apple StackExchange.

Hi, @finlander. Looks cool; thanks for sharing.

For those interested in this topic (@August?), you might want to also refer to the Hammerspoon docs: hs.spaces.

@finlander and others, you might also be interested in the following:

Both require Keyboard Maestro v11+.

2 Likes

Thanks Jim, and thanks Ville @finlander,

Yes, I'm interested, but for a while I'm still on Catalina. There's a Beta of HS from March 28, 2022 (v0.9.96) that I could try. It has one AppleScript command: "execute lua code", so clearly I'd lean to learn LUA to use it. Not a serious problem, but a seeming barrier to just banging around on it.

From a little browsing, the one feature I've found so far that I think I'd be interested in is making new Spaces, but I've solved that for now, for myself, by just making 45 Spaces up front by using a second monitor. At this point I still have a dozen Spaces that are so-far unused. (I have yet to find any mention of anyone else using that many Space and the erroneous advice that 16 is the limit is widespread.)

One thing I would like to test about HS in that regard: Is it limited like Mission Control to only being able to add a Space if there are 15 or less in the current monitor?

I got my Spaces count up to 45 by using a second monitor. I made 16 Spaces in each monitor and then I moved several spaces between monitors (moving Spaces is not limited to 16 per monitor) to have most of my spaces in my main monitor and just a few in the second. Then I could make more (up to 16 total) in the second monitor. Then I moved a bunch of those spaces to the main monitor to make room for more. Now that all of that is done, I have 45 spaces available on my laptop, with no external monitor, and I have not had a need for more. I also discovered that in Going from two monitors to one, the first Space in the second monitor disappears and its windows are moved to the first Space in the single monitor, so with a second monitor connected (not for over three years now) I would have 46 total spaces.

If Hammerspoon has the same limitation as Mission Control, then it wouldn't be buying me anything. Even for people wanting to copy my system, it doesn't seem worth what it would take to install HS and learn Lua to save a few dozen create and move operations. However, if someone were to create a script like Ville's StackExchange example, that did the creating and moving, it could definitely save some tedium for anyone creating a large Space array from scratch. Also, if I had a workflow that somehow depended on creating and removing Spaces, and if HS somehow gets around the 16-Space limit, then it could be useful.

I don't want to be shortchanging HS here. I haven't dug into it yet. It looks like it may be very useful for a lot of other OS operations, some that go beyond what KBM can do, but again I have not yet dug into it and probably won't any time soon.

Again, thanks Jim for the tag and thanks Ville for the Hammerspoon tip and for the example on Apple Stack Exchange / Ask Different.

Hi Ville,

Yabai claims to be able to make more than 16 spaces, but as you point out, it requires disabling SIP. Can Hammerspoon make more than 16 spaces in one screen? Your Stack Exchange example makes 10 in each of two screens, which is not the same.