Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
BBEdit Script to Open Here In Shell Worksheet
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
set output to return & "cd '" & theUnixPath & "'; pwd"
tell application "BBEdit"
set uws to Unix worksheet window
tell uws
select insertion point after last character
set selection to output
end tell
end tell
Copy link

rwilcox commented Mar 13, 2012

Copy this text into Applescript Editor, Save as Script your Application Support/BBEdit/Scripts folder. (This is located in your Library folder by default, but also could be in your Dropbox).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment