Created
October 21, 2010 11:54
-
-
Save jkeyes/638358 to your computer and use it in GitHub Desktop.
Opens a new tab in Terminal.app for the current working directory
This file contains 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
#!/bin/sh - | |
if [ $# -ne 1 ]; then | |
PATHDIR=`pwd` | |
else | |
PATHDIR=$1 | |
fi | |
/usr/bin/osascript > /dev/null <<-EOF | |
activate application "Terminal" | |
tell application "System Events" | |
keystroke "t" using {command down} | |
end tell | |
tell application "Terminal" | |
repeat with win in windows | |
try | |
if get frontmost of win is true then | |
do script "cd $PATHDIR; clear" in (selected tab of win) | |
end if | |
end try | |
end repeat | |
end tell | |
EOF |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment