Mac OSX Leopard Terminal & GNS3 / Dynagen

by becki on November 27, 2008

I’ve updated the osascript to one that works better than the original one that I posted.

I just finished a 3 hour tangent to my CCNA studies. I was going to mess around with EIGRP and OSPF configurations in GNS3 / Dynagen, but was a little annoyed with it opening a new terminal window for each console session. I’ve got Leopard, which uses tabs so it seems awfully silly to open a new terminal each time.

I thought this would be pretty straight forward since it can be done using iTerm fairly easily. I found it to be somewhat simple to open a new tab, although I had to take a crash course on Applescripts. The real problem is you don’t seem to be able to name the tabs even though there is a property that should handle it (custom title).

I muddled around with the script editor, the script dictionary, and spent hours on Google looking for an answer. All that to come to the same conclusion as everyone else; it can’t be done with Applescript. I did find a wrapper and a SIMB plug in, but don’t really want to go that far for this application.

After all that effort, here is what I have decided to live with as the command to launch a new terminal tab for GNS / Dynagen. You can copy it and paste it directly into the Terminal Command section of the GNS3 preferences.

I make no claims of being an Applescript expert, so use this at your own risk. Your results may vary.

Edit your dynagen.ini file to look like this:

# Uncomment below of OS X with Terminal with named tabs (requires Leopard)
telnet = /usr/bin/osascript -e ‘tell application “System Events” to tell process “Terminal” to keystroke “t” using command down’ -e ‘tell application “Terminal” to do script with command “telnet %h %p ; exit” in last tab of first window’ -e ‘tell application “Terminal” to tell window 1  to set custom title to “%d”‘

Old setting opened too many unused windows. Included here for reference only.

# Uncomment below of OS X with Terminal with named tabs (requires Leopard)
telnet = /usr/bin/osascript -e ‘tell application “Terminal” to activate’ -e ‘tell application “System Events” to tell process “Terminal” to keystroke “t” using command down’ -e ‘tell application “Terminal” to do script with command “telnet %h %p ; exit ” in last tab of first window’

Related Posts


Leave a Comment

Previous post:

Next post: