![]() ![]() We know where I left corner should be horizontally and vertically and we know how wide and tall the window should be based on the visible region of the screen. ![]() Now it all pays off with one action to move and resize the front window using the variables in our IF statements. We’ve done some math and some logical comparisons. Now let’s figure out which third of the screen our current front most window is in. If it’s below the midpoint then we want to snap to the bottom of the screen. If the top corner of our front window is above the mid point of the screen then we probably want to snap to the top of the screen. This uses the Keyboard Maestro IF flow control. Let’s start doing some logical tests of the window relative to the screen. Now we start figuring out where our current front window is on the screen. No need to add another action to do the math or to extract the width from the overall array of dimensions. For example, %Calculate%VarMainScreenVisible.Width/3% calculates the Width of the screen divided by three. It’s handy because it can calculate specific values of a screen or window. I think the neat thing about this is the KM %Calculate% function. These are all saved to variables that represent specific X & Y regions of the screen. There are a few additional KM screen calculations: As you can see below the coordinates are 0,25,3840,1575. I used the %ScreenVisible%Main% token to get the coordinates of the visible screen. This is important because I don’t want to try to move a window under the menu bar. First up, I needed to know the coordinates of the visible screen. I used Keyboard Maestro to help me figure out the grid coordinates. Resize and move the window to the grid position that the left corner is in.Figure out which grid location our window’s top left corner is sitting in.Chop the coordinates up into a lower and upper half as well as vertically sliced thirds.What are the visible coordinates of the main screen.When a window is just randomly thrown on screen I want a shortcut to make it fall in line with my grid. I familiarized myself with the Keyboard Maestro actions and got to work planning. Plus, I wanted to refresh some of my KM programming knowledge. Keyboard Maestro also comes with some examples for moving windows but none of them were what I wanted. Keyboard Maestro has three powerful features that I planned to use: One keyboard shortcut should allow me to cycle a window between all of the grid frames. It should also let me instantly resize a window that is not yet positioned on the grid so that it is. The keyboard shortcuts should let me move a window between the spaces on the grid. I’d like a set of keyboard shortcuts for moving windows around a grid on a large monitor. I keep Moom running for occasional assistance but I decided I wanted to dive into the new Keyboard Maestro and some KM programming. 1 When a window is on the right side of a 38" monitor and I want it snapped to the upper left corner, a mouse is the wrong tool. ![]() With so many pixels on screen dragging a window is very inefficient, which kills the utility of window snapping tools like Magnet or even BetterSnapTool and it’s big sister BetterTouchTool. Each of these windows is about the size of a 13" monitor: Here’s what a 38 inch monitor looks like. ![]() It was surprisingly hard to adapt to so many pixels but I’m loving almost everything about it. It’s a gorgeous 38" display that makes me feel like I’m working on a space ship. I have one suggestion for the Apple team that works on Spaces and window management: Get a big ass monitor. MacOS Monterey comes with some new window management tricks but they feel incomplete and a little frustrating. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |