Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save fractaledmind/6213769 to your computer and use it in GitHub Desktop.
Save fractaledmind/6213769 to your computer and use it in GitHub Desktop.
REQUIRED PROGRAMS: -- BibDesk -- TextMate (I have alternate code for TextEdit as well) This script automatically generates a list of sources indexed in your BibDesk databases in Markdown format. As I use Evernote to "host" my HTML notes, I also add the relevant MetaData to export the plain text to Evernote via the Markdown2Evernote python script…
tell application "TextMate"
--establish a variable for the line feed (aka LF key)
set LF to ASCII character 10
--insert the MetaData for export to Evernote
insert "# BibDesk Sources Index w/ biblio links" & LF & "= !nbox" & LF & "@ BibDesk, Source List" & LF & LF & LF & "**List of Sources in BibDesk Group**" & LF & LF & LF
--get relevant information from selected items in DEVON
tell application "BibDesk"
set these_items to selection of first document
if these_items is {} then error "Please select some content."
repeat with this_item in these_items
set CiteKey to cite key of this_item
set itemURL to "x-bdsk://" & CiteKey
set ItemName to title of this_item
set FinalText to "[" & ItemName & "](" & itemURL & ")" & LF & LF
--append a Markdown formatted link for all selected items
tell application "TextMate"
insert FinalText
end tell
(* If you don't have TextMate, here's the script for the universal Mac program TextEdit. To alter the code, merely delete or comment-out the TextMate tellblock and uncomment this block:
*)
-- tell application "TextEdit"
-- activate
-- make new word at end of text of document 1 with data FinalText
-- end tell
end repeat
end tell
end tell
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment