When I work on Rails, I would like to have two tabs open that are in the same directory. One for server log and another for running commands (e.g., script/generate) After opening the TextMate project file. I type ⌃⇧O to open the main directory in Terminal.
Then I run the following AppleScript.
tell application "System Events"
-- Need to wait a bit to avoild some conflict
-- No key should be pressed when this script is being run
do shell script "sleep 0.75"
tell application "Terminal" to activate
-- Change Kotoeri Input to Alphanumeric mode
keystroke ";" using {control down, shift down}
set the clipboard to ""
keystroke "pwd | pbcopy"
keystroke return
keystroke "t" using command down
keystroke "cd "
keystroke "v" using command down
end tell
I put the script in ~/Library/Scripts/Application/Terminal, and assigned ⌘⇧D using FastScripts.