Just made my first macro with this program today. Its a very simple one designed to move windows back and forth between my primary and secondary monitors. I can't figure out how to get it to work across multiple applications. It works wonderfully if I'm working within one application(such as Chrome), but I don't know how to make it work if the two monitors are displaying different notifications.
I have a similar macro that works for any app. It just moves the selected window to the other monitor. Maybe it will be of some help.
###MACRO: Move Window to Other Monitor (Screen)
~~~ VER: 1.0 2017-04-02 ~~~
<a class="attachment" href="/uploads/default/original/2X/1/1837f94ce32077c5d02a7a8bafd660a99532f59a.kmmacros">Move Window to Other Monitor (Screen).kmmacros</a> (19 KB)
This macro is uploaded in DISABLED state.
You will need to enable in order to trigger.
You may also want to change the trigger.
In order to work for ALL Apps, this macro must be in a Macro Group this is global with no app restrictions.
<img src="/uploads/default/original/2X/a/a11d80607985a65452cd63b174866b6794047bcc.png" width="562" height="1482">
The script has a limitation of 2 monitors. I wanted to modify this for 3.
The macros for Window Left/Right and Maximize do not work with properly if the external monitor is arranged to the left of the main display.
I’m trying to figure out what needs to be modified. I’m not familiar with Ruby, just poking around seeing what certain modifications do. Any pointers in the right directions would be appreciated - or advice if I’m better off dumping the Setup Frames script and going with discrete macros (like the one posted above).
It is designed to work with the "Main" screen, but you could easily change this to work with the "Front" screen, which is the screen of the frontmost window. The nice thing about this Macro Group is that everything is done using native KM actions -- no scripting.
Here's an example:
Since all of the above macros would work only with one screen (the Front screen), you could use my macro to move among screens. It is currently designed to toggle between two screens, but you could easily modify it to prompt for screen, if you like.
###[MACRO: Move Window to Other Monitor (Screen)](https://forum.keyboardmaestro.com/t/monitor-macro-optimization/6720/3)
Finally, rather than move windows among my screen to get to my mouse, I have a macro that moves the mouse to the current frontmost window whenever it changes (like when using a app switcher, Spotlight, LaunchBar, etc). I have not published it yet, but if there is interest, I could clean it up and publish it.
Hope this helps. Feel free to ask any follow-up questions.
Could this be modified to move a window to the next monitor if the hotkey is triggered again, and if the window is already equal. This was the main benefit I gained with the ruby script ‘Setup Frames.’