New Disk Browser for Window

Summary: Makes a new disk browser showing the current window’s parent folder.
Requires: BBEdit
Suggested Key Binding: Command-Control-B

Description

This script makes a new disk browser showing the current window’s parent folder. This is useful to quickly open nearby files. I prefer it to using Open File by Name because the graphical type-ahead lets me type only a few letters and still be sure which file will open.

Download in Compiled Format | Download in Text Format

Script

tell application "BBEdit"
    
set f to file of text document 1
end tell
tell application "Finder"
    
set p to container of f as alias
end tell
tell application "BBEdit"
    
open p
end tell