[TxMt] Re: Open Terminal

Geoff Beier geoff at mollyandgeoff.com
Tue Apr 22 03:04:36 UTC 2008


>
>  Haha. The author ends up recommending a variant of the same hack I settled
> for:
>
>     Tell application "System Events" to tell process "Terminal" to keystroke
> "t" using command down
>
>  What a disappointment! And why does "make" fail here? Ah well...
>

I finally settled on a slightly different hack that I like better.
Jacob Rus posted a couple of utility functions here:
http://pastie.caboo.se/14358

Using those, my make_tab function looks like this:
on make_tab(style)
	my menu_click({"Terminal", "Shell", "New Tab", style})
end make_tab

So the final script looks something like
property tabStyle : "Pro"
tell application "Terminal"
    activate
    make_tab(tabStyle)
end tell

I archived the utility functions here in case the pastie goes away:
http://geoff.mollyandgeoff.com/blog/2008/02/09/programmatically-create-new-tabs-in-leopards-terminal/

HTH,

Geoff



More information about the textmate mailing list