Return to Snippet

Revision: 28300
at July 6, 2010 19:26 by harrikauhanen


Initial Code
# Open a new tab on OSX Terminal with the current working dir.
# Optionally, pass the number of tabs as parameter.
#
# Example:
#
#   cd /my/very/long/path/and/i/dont/want/to/repeat/myself
#   nt 10
#
# You should add this to your ~/.profile
#
function nt {
  if [ $# -ne 1 ]; then
    TIMES=1
  else
    TIMES=$1
  fi

  osascript -e "
    repeat $TIMES times
      tell application \"System Events\" to tell process \"Terminal\" to keystroke \"t\" using command down
      tell application \"Terminal\" to do script \"cd $PWD; clear;\" in selected tab of the front window
    end repeat
  " > /dev/null 2>&1
}

Initial URL

                                

Initial Description

                                

Initial Title
Open multiple new terminal tabs on OSX using the current working dir

Initial Tags
osx

Initial Language
Bash