This is a little helper script for BBEdit to make View > Go Here in Terminal use iTerm2 instead of Terminal.app. You can't simply give BBEdit iTerm2's bundle ID directly because iTerm2 doesn't respond to the open instruction from BBEdit, for unknown reasons.
It's based on this pastebin which in turn was based on rwilcox/open_here.applescript. It differs from both of these in that it will open a new tab in the frontmost iTerm2 window if there is one, rather than always creating a new window.
You can just run this from the Scripts menu, but if you want to have BBEdit use it for View → Go Here in Terminal:
Open the .scpt
file in AppleScript Editor. Run it to check it works, if you want. Then File → Export…, choose File Format "Application", and tick "Run-only".
You'll get an application called “Go here in iTerm2.app”. Put this somewhere suitable. /Applications/Utilities
is a good choice.
Then from the command line issue this command:
defaults write com.barebones.bbedit TerminalBundleID -string "com.apple.ScriptEditor.id.Go-here-in-iTerm2"
If you changed the filename, you'll need to replace com.apple.ScriptEditor.id.Go-here-in-iTerm2
with whatever the new bundle ID is.
Howdy ideabucket. I made some revisions to a fork of this (thanks!), which are here: https://gist.github.com/awksedperl/9ba777980a4c2a9ceb8e2221558686ca/revisions. Is there a repo for this, or should there be? Not sure what the proper conventions for gist-based stuff are. Anyway, thanks and I hope my changes prove helpful, esp. since I am not an AppleScript hacker.