Be smart with MarsEdit

I'm making a lot of posts on another Micro.Blog blog just now. Of course I'm using MarsEdit, because I'm smart. 😀

I'm a fussy writer: I like my workspace just so. In the case of MarsEdit that means I want the editing window on the left, filling half the screen, and the preview on the right, filling the other half. I never think to use Fullscreen for anything except movies though, so the Menu Bar is still visible.

Just recently I've found these Applescripts handy to get things just how I like them.

1] get the bounds of the screen so I know where to put the windows.

tell application "Finder"
    get bounds of window of desktop
end tell

That got me this result: {0, 0, 1680, 1050}. Then I did some division and addition.

2] I made the Applescript to set my MarsEdit windows where I want them. Index 1 refers to the editor and index 2 to the preview. I make sure to click on the editor window so that it'll be index 1.

tell application "MarsEdit"
    set bounds of window index 1 to {4, 23, 840, 1046}
    set bounds of window index 2 to {841, 23, 1680, 1046}
end tell

Ahhhh.

If you're an Applescript person, feel free to help me improve on my index use. I just don't see how to address the two windows more specifically. Perhaps something's possible with the name?

And, by the way, I trigger this with Keyboard Maestro, because I'm smart in that way too.

Doesn't MarsEdit just do the right thing and remember where windows were? Well, of course, but sometimes 'stuff' happens…

Miraz Jordan @Miraz

Please take a look at my Love Waikawa Beach website too.