I had thought of assigning the apps in question to specific desktops, but thought that was too restrictive unless you would always want those apps on those desktops.
I do think I have a solution for you that will accomplish what I think you want, which is to be able to have a group of apps on screen and easily switch to another group and so forth.
Let’s, for the sake of illustration, say you have 9 apps, labelled A thru I, and you want them to appear on 3 desktops, with A, B, C on desktop1, D, E, F on Desktop 2, and G, H, I on desktop 3. For illustration I am also assuming only one display, but this easily generalizes to your second display.
You could write an AppleScript or a KM Macro that shows apps A, B, C and hides apps, D, E, F, G, H, I. A second script shows D, E, F and hides A, B, C, G, H, I, and so forth. The result is that with execution of the proper script, the apps you want on the “desktop” are shown and the ones that would be on a different desktop are hidden. You are using only one desktop but using automation to rapidly shift between the visible and hidden apps.
You could probably implement this with Moom which I believe has a feature to allow it to “memorize” and recall window configurations.
Since I don’t use Moom, I would do this with KM; depending on KM’s action library and how well it fit with this task I might use AppleScript actions in KM or not.
If I were to implement this (I might since this might be a better way than my current use of desktops), I would have a single KM macro that had multiple hot key triggers. In that macro I would retrieve the trigger so I would know how it was invoked and therefore which apps should be display and which hidden.
I would have a table, one row per app, with columns:
- App name
- “Desktop” the app should appear on (numbered 0, 1, …)
- Display the app should appear on (numbered 0 for your laptop display and 1 for the external display)
Another table correlates the triggers with the desktop number.
The macro gets the trigger, uses the table to find out which desktop is to be visible. Then iterate though the apps. If the desktop matches that in that table row, show the app on the designated display. Otherwise, hide it.
This would allow you to quickly and easily add/remove apps from this automation or move them from one desktop to another.
If you wanted you could add a column to the table for the app window’s location, but that starts to become very convoluted if the app has multiple windows open, so I probably would not do that. You could easily have another macro that found the current window coordinates for all windows for all the apps, wrote this data to a KM variable or a file, and a macro to restore things. (I guess at this point we might as well move to Xcode and write our own version of Moom…!).
This might allow you to accomplish what you are looking to do without being able to control the desktops themselves.
I don’t know if you can use AppleScript to set desktop backgrounds. Since desktops can have different backgrounds, that would be useful if you use different backgrounds to differentiate your desktops (I actually use a neutral gray on the desktop where I do photo editing but the standard MacOS background on all others).