Move current window to specific size/location (of any application)
I often have a small chat program running, I keep it in the bottom right corner of my screen. It's kind of a stupid application, so it never pops up above active windows for an update, so I keep it uncovered - this means all my windows have to be shrunk to fit, and to not hide it.
Now, because I'm such an OCD person, I like to have a perfect, 1px border between applications, and I like things to be neat and orderly, etc. That means there's a VERY specific place all my windows go. When I open a new one, however, they can be in any shape, size, etc.
Using applescript, I've had some success - if I target a specific application, I.E., firefox, it works. Just for firefox, this is the script:
tell application "Firefox"
activate
set the bounds of the first window to {0, 0, 1173, 1178}
end tell
However, I want the script to work with ANY application. I've tried a few variations, with stuff like setting "frontapp" to the "process whose foremost is true" or something like that, and then telling frontapp to adjust it's window's bounds, but it never worked correctly, and I threw it all away.
Are there any script that are already set up to do this, or how would I go about writing a script (application) to do it? I can set up a hotkey for it, which is no problem (I already got around the 'control in the hotkey' problem, that was a pain) but the script itself is not fun. Any help?
MDD G4, Mac OS X (10.4.11)