iTermにコマンドを送るスクリプト
NetBeansとかからすぐにターミナルのディレクトリ変えたり、viしたりしたいので寄せ集めで作った
##!/bin/sh
#
# ref. http://d.hatena.ne.jp/goth_wrist_cut/20090922/1253604644
# ref. http://homepage.mac.com/tkurita/scriptfactory/Softwares/terminal/fcd/index.html
`osascript << EOS
on run argv
set originalDelimiter to text item delimiters of AppleScript
set text item delimiters of AppleScript to " "
tell application "iTerm"
activate
#tell (make new terminal)
tell the first terminal
launch session "Default"
tell current session
# write text (argv as string)
write text ("$1")
end tell
end tell
end tell
set text item delimiters of AppleScript to originalDelimiter
end run
EOS`
AppleScript なかなかおもしろいな