Created
January 23, 2015 17:06
-
-
Save hongjiang/2fe85e152d942c7f73ab to your computer and use it in GitHub Desktop.
call mac osascript open a new Terminal.app
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
newTerminal(){ | |
osascript 2>/dev/null <<EOF | |
tell application "System Events" | |
tell process "Terminal" to keystroke "t" using command down | |
end | |
tell application "Terminal" | |
activate | |
do script with command "cd $PWD" in window 1 | |
do script with command "$*" in window 1 | |
end tell | |
EOF | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment