Last active
April 7, 2017 00:58
-
-
Save davidfmiller/b152db1e5e3b0e4f1e87d048cb9f138b to your computer and use it in GitHub Desktop.
Close Other Documents in Window
This file contains 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
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