Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@davidfmiller
Last active April 7, 2017 00:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davidfmiller/b152db1e5e3b0e4f1e87d048cb9f138b to your computer and use it in GitHub Desktop.
Save davidfmiller/b152db1e5e3b0e4f1e87d048cb9f138b to your computer and use it in GitHub Desktop.
Close Other Documents in Window
try
tell application "BBEdit"
set mywindow to window 1
set mydoc to (URL of document 1 of mywindow) as POSIX file
set alldocs to documents of mywindow
repeat with doc in alldocs
if ((((URL of doc) as POSIX file) as string) is equal to (mydoc as string)) then
-- active doc
else
close doc
end if
end repeat
end tell
on error
beep
end try
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment