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
-- based on http://pastebin.com/MSPZWWAj | |
-- which was in turn based on https://gist.github.com/2006738 | |
-- but will open a new tab in the current terminal if one is open, rather than always creating a new terminal | |
tell application "BBEdit" to set theFile to file of document 1 | |
tell application "Finder" to set theFolder to (container of file theFile) as alias | |
set theUnixPath to POSIX path of theFolder | |
tell application "iTerm" | |
if exists current window then |