Skip to content

Instantly share code, notes, and snippets.

@ymendel
Created August 14, 2008 22:46
Show Gist options
  • Save ymendel/5507 to your computer and use it in GitHub Desktop.
Save ymendel/5507 to your computer and use it in GitHub Desktop.
#!/bin/sh
CWD=`pwd`
case $1 in
/*)
DIR=$1
;;
*)
DIR=$CWD/$1
;;
esac
osascript<<END
set thePath to "$DIR"
set thePath to (POSIX path of thePath as string)
tell application "Terminal"
tell application "System Events" to tell process "Terminal" to keystroke "t" using command down
do script with command "cd " & quoted form of thePath in front window
end tell
END
#!/bin/sh
CWD=`pwd`
case $1 in
/*)
DIR=$1
;;
*)
DIR=$CWD/$1
;;
esac
osascript<<END
set thePath to "$DIR"
set thePath to (POSIX path of thePath as string)
tell application "Terminal"
do script with command "cd " & quoted form of thePath
end tell
END
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment