Macro to automate desktop spaces (New to KM and need help needed troubleshooting final step)

Hi all! I've recently created a macro that is designed to let you automatically organize a few apps across spaces on your desktop with a keypress (very useful for a 2nd monitor). I think I've got it mostly working (with the help of this macro Move Window 1 Space Left/Right or to Different Desktop), but have hit a small wall. Instead of being dragged to the specific desktop they are told to, the apps seem to be placed on a completely random desktop (especially Slack, for whatever reason).

To give you a better idea of how it's supposed to work, you're supposed to press a keyboard shortcut, then have it launch messages > make it full screen > move it to Desktop 2, then launch Slack > make it full screen > move it to Desktop 3, and so on. At the end, it returns you to Desktop 1.

Could anyone by chance take a look at it (its actually 4 macros executed by 1 to help organization) and see if there is anything immediately glaring as wrong in my implementation? Still pretty new to KM, so I may just be missing something.

Thanks in advance!

Organize Spaces Automation Macros.kmmacros (37.8 KB)

Something that stands out to me in your macro is that the triggers for the individual macros are used in the macros themselves. So for the Calendar macro, the trigger is ⌃4 and then within the macro the same hotkey is pressed (most likely to move the window to desktop 4), that could cause the macro to trigger again rather than move the window. If that's the issue I would either change the triggers of the macros to something else or go into System Preferences > Keyboard > Shortcuts > Mission Control and change the hotkeys in for Switch to Desktop to some other hotkey (like ⌘⌃⌥1).

Just tried it by adjusting the System Preferences shortcut Switch to Desktop 3 to ⌘⌥⌃3 and it worked for me, I also added a pause after the app is activated because sometimes an app may not come to the front that quickly.

1 Like

Thanks for your help! For some reason, even with your very helpful suggestion, Slack and Calendar just weren't ever properly resizing for me. Based on an idea you gave me though, I redid the automation and changed it to just switch spaces and move the mouse to toggle fullscreen, which seems to be working 100% of the time now for me.

Thank you again! I learned a ton about KM from your post and from this process.

My issue now is that I cannot for the life of me find a way to make a reverse automation to hide the apps (since the normal keyboard shortcuts for hiding don't work for fullscreen apps, and I can't even figure out how to do it by having KM move the mouse and do it). Oh well haha.