Hi, I'm new to this but have been really in the weeds the past few weeks. I set up a mouse button that'll move the open application to the screen my mouse is on. I'm trying to figure out the easiest way to set up a single button to move all open applications to the mouse as if I was command tab-ing through the programs and hitting the side button. I'm having trouble figuring out how to calculate the open applications to determine the amount of repeats the command tab + move combo has to go.
I wish I could help, but I don't know what the above statement means. What is a "side button?" Is that some sort of mouse button? I can't figure out what that means.
Also, what would you want the macro to do if your monitors are different sizes and the windows need to be rescaled? How should the windows be rescaled, if at all?
Also, are you aware that it's not "apps" that need to be moved, it's "windows." An app can have 0, 1 or more windows that are open, and I presume you want all windows moved for every app that's running.
Did you know macOS has a way to do this on its own, without Keyboard Maestro? If you have two monitors, all you have to do is open System Preferences, find the Display pane, select the secondary monitor, and make it the Main Display. When you do that, all the apps switch to the other monitor. If this is good enough for you, we could probably write a macro using Keyboard Maestro to do that with a single hotkey.
Hi, thanks for helping!
So I currently have a macro to move the front window to the screen my mouse cursor is placed on. I'd like to move every single window from all open applications to that screen with one button. I'm not looking to change the main display, just group all windows from all apps to the selected screen.
Forget the rest of what I said, I added a bit of word salad because I still had all my previous attempts swimming around in my head.
It might save us some time if you show that macro.
On the other hand, I am going on a vacation tomorrow and so I think you'll have to rely on others to write the code for you.
Are your two monitors the exact same size and resolution? It may simplify the problem.
You can't really "move applications to the screen my mouse is on". You can "move all windows of all open applications to the screen my mouse is on". Is that what you want to do?
Meanwhile, you might be able to build on what you already have. KM has "Collections" which a "For Each" action can loop through one item at a time, performing actions on each item in turn -- and one of the Collections is "The running applications". So you can activate each open app in turn, then perform the actions you already have to move its windows:
Each Running App In Turn.kmmacros (3.4 KB)
Thank you so much, that was what I needed!
Here's the end result if that's of interest to anyone.