Created
April 22, 2009 21:12
-
-
Save EvanBurchard/100080 to your computer and use it in GitHub Desktop.
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
Ripped off from: | |
http://ask.metafilter.com/87956/Please-help-me-make-my-terminal-work | |
on run argv | |
tell application "System Events" to tell process "Terminal" to keystroke "t" using command down -- open a new tab | |
tell application "Terminal" to do script "cd " & item 1 of argv in front window -- change directory | |
end run | |
Save this script as /Users/[username]/scripts/newtab.scpt | |
Now you can open a new tab in the current directory using: | |
osascript ~/scripts/newtab.scpt `pwd` | |
Finally, add a line to ~/.bashrc which aliases this to something convenient, e.g.: | |
alias newtab='osascript ~/scripts/newtab.scpt `pwd`' | |
If you don't normally use a .bashrc, you might need to make a file ~/.bash_profile containing the single line: | |
source ~/.bashrc |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment