Skip to content

Instantly share code, notes, and snippets.

@davidfmiller
Last active November 24, 2017 21:34
Show Gist options
  • Save davidfmiller/bb90c3b0f9c0808943a662877a7f275d to your computer and use it in GitHub Desktop.
Save davidfmiller/bb90c3b0f9c0808943a662877a7f275d to your computer and use it in GitHub Desktop.
Copy text document paths in the active BBEdit window to clipboard
(*
Copy paths of all open text documents in the active BBEdit window to your clipboard
*)
tell application "BBEdit"
set mydocs to every text document in window 1
set urls to ""
repeat with doc in mydocs
set myurl to (URL of doc)
if (myurl is not missing value) then
set myurl to ((characters 8 thru -1 of myurl) as string)
set urls to urls & {myurl} & "
"
end if
end repeat
end tell
if (urls is equal to "") then
beep
else
set the clipboard to urls
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment