New Terminal Tab
public ruby v1 · immutable#!/usr/bin/env ruby# load AppScript bridgerequire 'rubygems'require 'appscript'include Appscript# access the terminal and create a new tabterm = app('Terminal')app('System Events').application_processes["Terminal.app"].keystroke("t", :using => :command_down)# execute the command in that tabwindow = term.windows.firstterm.do_script("cd #{ARGV[0] || `pwd`}; clear", :in => window.tabs.last.get)