I’ve been published!
My little Applescript vi hack has made it to http://macosxhints.com with just a bit of editing.Yay! http://www.macosxhints.com/article.php?story=20080305012955463
I have a blog anyway.
{ Monthly Archives }
My little Applescript vi hack has made it to http://macosxhints.com with just a bit of editing.Yay! http://www.macosxhints.com/article.php?story=20080305012955463
Blog, blog, blog, blog. Shocking, the amount of comment spam a blog with no readers can attract.

Fresh Paint
Originally uploaded by sambo in netanya.
I’ve always been a vi guy, but OS X vi GUIs leave a lot to be desired. So for years I’ve put up with TextEdit as the default application when I double click a text file in Finder or an attachment in mail.
Until yesterday. Using this old macosxhints.com forum thread as the base, updated and modified to behave properly, double clicking a text file now opens it in vi in a new tab in Terminal, opening Terminal if it’s not already (which is rare, as I usually have 4 or 5 tabs open all the time).And here it is… Please let me know if it can be improved in any way.
on open inputfile
ignoring application responses
tell application “Terminal”
activate
tell application “System Events” to tell process “Terminal” to keystroke “t” using command down
do script “vi “ & quoted form of POSIX path of inputfile in selected tab of the front window
end tell
end ignoring
end open