Created
January 3, 2010 18:53
-
-
Save harrikauhanen/268080 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment