Dual Monitors, Snap Browser Window to 2nd Screen

I have a cheese grater Mac Pro with video card that supports 2 screens. 2nd screen is a flatscreen TV via HDMI. I use Firefox browser to watch Disney+ and other video programming. Instead of dragging the browser window from one screen to the next, is there a macro that will snap it to the 2nd screen? And then maybe back again to screen 1? Or create a new window that is assigned to the 2nd screen?
Thank you, LesB

I searched these forums and found someone with a similar question and one of the answers came from The Architect himself, so I shouldn't try to explain it myself.

But I will anyway. KM gives you the tools to place the windows anywhere you want on either screen using a single coordinate system that combines both monitors in a single coordinate system. It's up to you to be aware of the coordinates for both screens. But if you move the screens around using System preferences, the coordinates will change and you have to handle all that. Are you prepared to handle all that?

On this web page it appears to me that someone tried to solve the problem using screen numbers, as it appears that you want to do. The comments were that the macro worked well. So try it out.


I have a whole set of macros that move the active window around my dual-monitor setup. All of them are triggered by the same keystroke (command-control-z), and I name them in ways that let me easily use the conflict palette to select the one I want. Here, for instance, is a macro that will move the active window to the right side of my secondary monitor when I type command-control-z, then 2, then r:

2 zoom window to right of second screen Macro (v10.0.2)

2 zoom window to right of second screen.kmmacros (4.5 KB)

You can see that it also calls two other macros, which function as subroutines in a lot of my macros. The first sets the window to the maximum height for the new monitor, since my monitors have different dimensions and resolutions, by running this single action:

Manipulate a Window Action (v10.0.2)

Manipulate a Window.kmactions (902 B)

and the other is a slightly complex one that ensures the window is fully on the visible area of the screen, and gets it onscreen if not. It's probably not needed, which is why I'm not posting it as well; I wrote it before I'd fully realized how much better it is to use the SCREENVISIBLE() function everywhere instead of numbers. But I keep it around as a safeguard.

Anyway, I hope you can use these macros as springboards to write your own macros that will move your windows wherever you may want them!

1 Like

Thank you Shoshanna!