Last active
July 8, 2016 11:47
-
-
Save bobrocke/91c367189ebbb2f2741e2e79e5072bb3 to your computer and use it in GitHub Desktop.
An AppleScript to open iTerm2 at the file system location of the selected file or folder in BBEdit.
This file contains hidden or 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
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" | |
activate | |
tell current window | |
close | |
end tell | |
tell (create window with profile "Default") | |
tell current session | |
write text "pushd \"" & theUnixPath & "\"" & "&& clear" | |
end tell | |
end tell | |
end tell |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment