Window Management Macro Help

I am trying to figure out a way to make the following:

I want to be able to type a hot key (option + cmd + enter) that will Center and Resize to the specific sizes in the below picture.


I do not know how to make it so that the same hot key will work for all programs, but specific to that program. I am not sure if that makes sense.

Basically, i want it so that Option+Cmd+Enter will Center and Resize Safari to 1264 pt x 797 pt, Center and Resize Finder to 770 pt x 436 pt, etc. depending on which is the front window.

If anyone is willing to help, it would be appreciated.

I've got the sizing to the specific dimensions down (i think), but cant figure out a way to make it specific to that particular program that is the front window. Also, so that the ONE hot key (opt+cmd+enter) will work for all of them so that i dont have to use so many different hotkeys.

There is a chance that i just repeated everything for a second time, but i just want to make sure i am being clear. LOL

And if anyone is wondering how i got those dimensions... They are the apple default window sizes for the 13in macbook pro.

This should get you going. The macro sets the window size based on the front application (using a token) and, in a separate action, centers it.

Default Window Sizing.kmmacros (5.3 KB)

I'm not sure what you mean by that.

Firstly though, you create a set of macros, give them all the same hot key, and each one resizes to the various size (so use the Manipulate a Window action and the SCREEN function to move and resize the window to the center with the specified coordinates, eg:


I don't really understand what you mean by “depending on which is the front window” - how do you determine which size you want from the current front window?

Thank you so much Peter and mrpasini. I ended up using a combo of your two ideas. I am just getting started on keyboard maestro. This is my first creation actually and really do not know what i am doing LOL.

Default Window Sizing.kmmacros (16.5 KB)

Not sure if i load the above image correctly. It goes a bit further when you click on it.

That seems like a good start to my windows management solution. I also have other macros that will move any window to the top,bottom, left, right on both my macbook screen and an external monitor.

Now i just need to figure out what to do for all the apps that aren't those stock apple apps.

If i wanted to do a 'does not contain' action for anything not finder, safari, calendar, etc.... how do i separate them in the 'does not contain'.... commas?

You're working too hard. The SCREEN calculations are unnecessary in my example macro because they are all done by the last Center Front Window action. All you have to do is add another Switch case for any application's window you want to resize.

When that window is at the front (which ever window it is), run the macro and the window will be resized to your specifications and centered on whatever size screen you are running.

Since the macro is not fired automatically but manually, I don't understand why you would want to qualify it with a 'does not contain' but you could do that with an If-Then-Else action within the Switch case section for that application.

Part of the reason i was doing the SCREEN calculations is because at some point i may want to go back and move some of them to places on the screen like slightly above center and what not. I don't know of any other way to do that, but i definitely do not want to be limited to JUST centered.

As for the other thing, here's my thinking:

I have things set up for most of the stock apple apps to resize to the exact position and place on the screen that they are when opened for the first time on a brand new Macbook pro. So basically i can hit the hot key and send them back to THAT size and location on the screen, no matter how much moving around and resizing i have done prior.

I still do not know what to do with things like third party apps (apps that are not safari, mail, calendar, contacts,etc.). My thinking was to just have a universal size and location that will be used for any app NOT called safari, mail, calendar, etc.

I am sure there is a much easier way to do this task of window organization somehow, some other way. Like i said, i have never done anything anywhere this close to being a "Power User" customization.

To be honest, I saw keyboard maestro had a way of doing window management. So I purchased it and this is my first crack at it. LOL.

I am coming from using Moom which is where the following screen shot comes from. But I do not love the idea of having a program installed on my app that does only ONE thing. Since keyboard maestro can do that ONE thing along with many other things, i would rather go with that.


If you are using the Application token you can use a regex match like:

1 Like

If you're using the Switch or Case action, you can use the Otherwise clause to handle any other applications.