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.

2 Responses to “Double click for new terminal”

  1. Derek says:

    Hmm, the command doesn’t seem to work for me or maybe I just did not do it correctly. Maybe you could have included a screenshot of what it should look like after the process so that I would know whether or not I messed it up.

  2. MikeP says:

    I’m not sure where you’ve gotten stuck, I suspect it’s at the File|Export stage. Have a look at
    Screenshot 1, which shows Script Editor exporting,
    and
    Screenshot 2, which shows what your icon should look like. Note that I’ve told my Finder to show all extensions, yours might be just called Whatever, instead of Whatever.app.