Monitor Macro Optimization

Hey all,

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.
Thanks!

PS. Was there a way to screencap this without multiple grabs?

Edit > Copy as Image

Congrats!

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 ~~~

####DOWNLOAD:
<a class="attachment" href="/uploads/default/original/2X/1/1837f94ce32077c5d02a7a8bafd660a99532f59a.kmmacros">Move Window to Other Monitor (Screen).kmmacros</a> (19 KB)

---

###ReleaseNotes

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">

Similar situation,

I’m using the ‘Setup Frames’ script from the Window Movers default macro (https://wiki.keyboardmaestro.com/Window_Movers) and it works like a charm. However,

  • 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).

Thanks.

I don't know anything about Ruby, so I can't help you with making changes to the Ruby script. I'm not sure how many other members here do program in Ruby as it is not often discussed.

Here is another Macro Group/Palette that I use that you may want to consider:
Window mover/resizer macro package

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:

###Stretch-Tall
Change this:

TO:


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.'

Also thank you very much for the previous link.

Also to note: With the window mover macros combined with native KB SCREEN function I did not have as much success with manipulating VM windows as I have with the ruby script.

Sources:
(https://forum.keyboardmaestro.com/t/how-to-detect-external-display-and-conditionally-move-windows-to-it/1011)
(https://forum.keyboardmaestro.com/t/move-and-resize-window-in-another-screen/1185/5)