I've got a little bit of ruby that sizes and repositions windows to a saved layout. It uses a snippet of AppleScript to actually do the positioning:
osascript -e 'tell application "Twitter" to set the bounds of the front window to {894, 22, 1604, 1049}'
There are two problems though:
This doesn't work for every app, for instance when I use it to set the position of Gitbox, I get the following error:
37:43: execution error: Gitbox got an error: Can’t get bounds of window 1. (-1728)
Some window positions aren't saved, for instance if I run the script to reposition everything, then I close the MacVim window and open a new one, it will not remember the position of the window that was just closed.
Is there a more robust way to set the size and positions of windows?