Position and Resize Windows with Keyboard Maestro

There are dedicated tools like Magnet and Display Maid to position and resize windows. However, if you have Keyboard Maestro you can emulate that functionality. It takes a small amount of effort and two simple macros.

The first step is to arrange windows in the desired location and at the correct size. That done, it’s time to create a simple macro to record the window locations so they can be used in another macro.

Keyboard Maestro has built-in commands to display the window name, position, and size. We’ll use these to capture the coordinates of the window.

Top: %Calculate%WinFrame.Top%
Left: %Calculate%WinFrame.Left%
Width: %Calculate%WinFrame.Width%
Height: %Calculate%WinFrame.Height%

Macro to get the window title and screen position

This macro will trigger when the window focus changes. As you click different windows, the name and position are displayed in a Keyboard Maestro result window. This is a macro you will want to turn off once this bit of testing is complete.

Window position and name

With all the window positions recorded, the next step is to use the Move a Window block to set those values.

After moving a window, it can be resized using built in actions of Full Screen, Left Column, Right Column etc. This is similar to Magnet.

Move and Resize a window using built in option or choose Custom

There is also a custom size which I use for Messages, Slack, and CopyLess. These are for my vertical monitor.

At this point, it’s a process of chaining all the blocks together for each app you want to configure. The apps can be resized as part of a hotkey or when they launch.

There is some manual effort to set this up, but once it’s done, your desktop can look however you like. Display Maid has profiles for different workflow configurations. Keyboard Maestro can have different macros to accommodate different workflows. You could have a Dev config, Writing environment, or Video setup, where apps launch and move for a consistent environment.

I have this set up on my work machine and it has served me well this last year. I use Magnet to move windows on my main monitor, but have Keyboard Maestro control the other three so everything looks the same each day.

You can more on Window Frames and moving windows at this Wiki entry.

Display Window Position and Size
Position Window on secondary monitor

Maybe I should've written that in a different font.
Author Signature for Posts