When positioning windows vertically (one above another) I've found that I need to use SCREENVISIBLE and an offset to the Y position.
I tried various combinations of SCREEN, SCREENVISIBLE, and offset values. This seems to the settings that work best for my Macs.
I selected 23 because the vertical dimension of my menubar is 24 pixels on my 16" MBPro and 22 pixels on my Mac mini (displayed on my 27" iMac with target display mode).
Am I missing something that would make this easier?
DOWNLOAD Macro File: Position N Windows.kmmacros (7.6 KB) Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.
My objective was to create a subroutine macro that positions and resizes windows specifying x, y, width, and height (all in percentages), e.g., 0 0 50 60, 0 60 50 40, and 50 0 50 100.
Ah, thank you! I missed that function in the wiki/documentation.
With that information, my subroutine now uses this action:
For those that might be interested, here's the subroutine:
DOWNLOAD Macro File: sub—Position-Resize Front Window.kmmacros (8.1 KB) Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.
DOWNLOAD Macro File: Position 3 Windows.kmmacros (4.1 KB) Note: This macro was uploaded in a DISABLED state. It must be ENABLED before it can be run. If it does not trigger, the macro group might also need to be ENABLED.
Your recommendations work perfectly with a few minor exceptions that I thought might interest you and others:
With Mojave (macOS 10.14.6) if the Dock is right/visible, the right window partially overlaps the Dock.
With Monterey (macOS 12.3.1), the same behavior is seen but only under certain sequencing:
If the Dock preferences are left/visible and then changed to right/visible, there is no window/Dock overlap.
If the Dock preferences are left/autohide, changed to right/autohide, and then changed to right/visible, there is a window/Dock overlap.
With Mojave (macOS 10.14.6), if System Preferences > General > Automatically hide and show the menu bar, then the windows overlap a bottom/visible Dock. Interestingly, the left-bottom window overlaps somewhat more than the right window.
With Monterey (macOS 12.3.1), if System Preferences > Dock & Menu Bar > Automatically hide and show the menu bar on desktop, then the left-bottom window overlaps the bottom/visible Dock.
These anomalies don’t effect me because I always use a left/autohide Dock and I never autohide the Menu Bar.