Filed under: How-tos, Tips and tricks, Macbook Pro
Applescript to arrange your desktop
Here's a very cool tip we first saw at Lifehacker. Jeff Kelley is a MacBook Pro user who, like many others, connects it to several displays, depending on context and the task at hand. If you've done this, you may be familiar with the same irritation that has bothered Jeff. Namely, application windows re-sizing themselves across displays. The difference between Jeff and the rest of us is that he did something about it.
Here is a great AppleScript that notices his screen resolution and sizes his application windows according to his likes. Now, Mail, iCal and so on will appear just where they ought to. Very cool!

![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 1)
Aron T said 10:29AM on 5-22-2008
I have been playing with this since last night and I think I am finally satisfied with the outcome; here are some things I ran into...
1) The quotation marks are not copying correctly from the site into script editor so you will have to replace them manually prior to compiling.
2) The format of the bounds for the windows is also useful to know. First notice that the very top of the desktop is y=0 and the very left the screen is x=0. The window bounds follow this format (dist x left, dist y top, dist x right, dist y bottom). Distance from x(y)=0 to [window side]. If that doesn't make sense I'll try to make a visual diagram.
3) You can quickly find the values of distances using CMD+SHIFT+3 and looking at the coordinates as you drag the selector around the screen.
4) Because of how I like my windows I found it easier to do all of the resizing within two if-statements. ie. If Width = 1920 size the windows this way, If Width = 1440 size the windows that way.
I'll also go ahead and put all of this on my site as well as a copy of my script so anyone who cares can take a look.
http://aroncares.com
Reply
SlaunchaMan said 7:27PM on 5-29-2008
FYI, I've made some changes to the original script on my blog. It's now much more user-friendly.
Reply