Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

IDMah

macrumors 6502
Original poster
May 13, 2011
316
11
Hi all.

It there a way to programatically record resize and reposition application windows.

Not my application but other application .. ie. safari, mail

I'd like to be able to create environments. say Mail Full length on the left and Safari on the right .. but then be able to switch to Safari on the top mail and something else on the bottom...

I'd also like it to launch these programs as well ...

thanks
Ian

ps. If there is something already out there that does this then please please let me know.. spending too much time moving window around..
 

res1233

macrumors 65816
Dec 8, 2008
1,127
0
Brooklyn, NY
Hi all.

It there a way to programatically record resize and reposition application windows.

Not my application but other application .. ie. safari, mail

I'd like to be able to create environments. say Mail Full length on the left and Safari on the right .. but then be able to switch to Safari on the top mail and something else on the bottom...

I'd also like it to launch these programs as well ...

thanks
Ian

ps. If there is something already out there that does this then please please let me know.. spending too much time moving window around..

Here's some AppleScript:

Code:
tell application "Safari" to get bounds of window 1

Code:
tell application "Safari" to set bounds of window 1 to {20,20,500,500}

The first script gets the position of the window, top left corner then bottom right corner {x,y,x,y}. The second script sets those values.

You can replace "window 1" with "window 'name'", replacing name with the name of the window, for a little more precision.

If you'd like to scale those values based on the resolution being used (ideal) use this script to get the resolution:

Code:
tell application "Finder" to get bounds of window of desktop

If you have no idea how to use Applescript, I could write it for you, just ask. ;) I enjoy this stuff.
 
Last edited:

IDMah

macrumors 6502
Original poster
May 13, 2011
316
11
thanks

That's awesome, I knew it was in there somewhere. Just too stupid
to find it..

Hopefully I'll find time to bash together the project I'm thinking of and Send
you a copy when it's done.

just tired of moving window all day..

thanks
Ian
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.