Tag Archives: apple

Double click for new terminal

I’m completely dumb at the Apple-way-of-scripting. I wanted something I could throw on my desktop that I could double click and it would open a terminal window and ssh somewhere. I’m not sure how useful this will actually *be* to me, but given it took me non-zero time with google to figure it out… thanks to various stackoverflow posts.

Open Applescript Editor. Put in:

tell application Terminal
do script "ssh hostname"
set bounds of front window to {63, 640, 1212, 1022}
end tell

File | Export … and save it as an application. Put it on your desktop, giving it a reasonable name. Done. If you want to later edit the script (say, to set boundaries :) ), right click, Show Package Contents, then go into Contents\Resources\Scripts and edit the main.scpt file you’ll find. The “set bounds” statement places the window at the bottom-left-ish and makes it 160×25 at my current resolution and font size. I can’t figure out how to tell Terminal to just set itself to 160×25 without also moving it, and I expect that the actual characters displayed depends on font, size, etc.

Making Mail.app usable

Thunderbird finally drove me over the edge. Might have been that whole “no new features OH HEY YOU CAN IRC FROM YOUR MUA” – guys, if I wanted emacs, I’d use it.

I used to care a lot about Enigmail. For various reasons, I care less about it now. There are, however, a few things that I would miss about it. Oddly, the one that I kind of missed the most is the most whimsical – I like having my default signatures rotate. So I did a bit of digging, and came up with some applescript (courtesy clapper.org‘s post on the subject) only slightly modified.

Also, being a complete Mac-centric scripting n00b, I wasn’t sure how to make things go. Save the Applescript into a file called… anything. Run osacompile against it. You can call the resulting compiled script from your .bashrc with osascript, something like

osascript /Users/foo/bin/sigrot.scpt

Another relatively minor irritation is the default behaviour of never marking mail as read, or marking it as read instantly. You can theoretically fix that with

defaults write com.apple.Mail MarkAsReadDelay 4

but that didn’t work for me (10.8.1). Instead, I used TruePreview.

Now, if only I could convince it to show me messages most recent at the top, but when they’re threaded, show them most recent at the bottom.