[TxMt] Re: Open Terminal

Mark Eli Kalderon eli at markelikalderon.com
Tue Apr 22 02:22:43 UTC 2008


>>> Is there a way to modify the Open Terminal command so that it uses
>>> tabs with Terminal.app? I have been trying to do this but my
>>> applescript-fu is weak. :/
>>
>> I see there is plenty of support for this in the scripting  
>> dictionary,
>> but I also don’t get AppleScript.
>>
>> I tried first:
>>
>>     tell app "Terminal" to return tabs of first window
>>
>> This worked fine, so then I tried:
>>
>>     tell app "Terminal" to make new tab in first window
>>
>> That gave me:
>>
>>     Terminal got an error: Can’t make or move that element into that
>> container. (-10024)
>>
>> And then I gave up :)
>
> Giving up is correct behavior! :))) The whole frustration with  
> AppleScript
> is that you have no way of knowing whether a feature is implemented  
> ("Is it
> possible to script the Terminal to make tabs in a window?") and, if  
> so, what
> the syntax is for making it happen.
>
> I believe the matter at hand (unless I've misunderstood - I haven't  
> really
> been following along) has been pretty well discussed here:
>
> http://onrails.org/articles/2007/11/28/scripting-the-leopard-terminal

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...

Best, Mark


More information about the textmate mailing list