/ Published in: Bash
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
# 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 }