I found it a little long-winded to import PDFs from the web into my BibDesk library. My old workflow was as follows:
- Open the PDF in my browser.
- Choose “Save Page as…” from the menu bar, and save the PDF to my desktop.
- Open BibDesk.
- Drag the PDF from my desktop into my BibDesk library.
- Edit the title/author etc. of the new publication.
- Hit shift-cmd-k to ‘auto file’ the downloaded PDF into my Papers folder.
Below is an AppleScript I wrote to automate this procedure. Now my workflow is:
- Copy the URL of the PDF file.
- Launch the AppleScript below (a keyboard shortcut can be configured for this).
- Paste the URL.
- Edit the title/author etc. of the new publication.
Much nicer!
-- Get URL of a pdf file
tell application "Finder"
set returneditems to (display dialog ¬
"Enter PDF URL:" buttons {"Add", "Cancel"} ¬
default answer "" default button 1)
set buttonpressed to button returned of returneditems
set theURL to text returned of returneditems
end tell
if buttonpressed = "Cancel" then
return
end if
-- Make sure all existing publications are auto-filed
(* This is necessary because the last pdf added by
this script will currently be stored at
~/Documents/Papers/downloadedpaper.pdf, which we
are about to overwrite. *)
tell application "BibDesk"
activate
open "/Users/johnwickerson/Documents/Papers/John.bib"
set theDoc to get first document
tell theDoc
repeat with thePub in publications
tell thePub to auto file
end repeat
end tell
end tell
-- download pdf
set localfile to ¬
"/Users/johnwickerson/Documents/Papers/downloadedpaper.pdf"
tell application "URL Access Scripting"
download theURL to localfile replacing yes
end tell
-- add new publication to database
tell application "BibDesk"
activate
open "/Users/johnwickerson/Documents/Papers/John.bib"
set theDoc to get first document
tell theDoc
set newPub to make new publication ¬
at the beginning of publications
tell newPub
add (POSIX file localfile) to ¬
beginning of linked files
show -- open info box
end tell
end tell
end tell
Comments on: "Adding PDFs to BibDesk" (1)
I have a bit of a different approach. I usually start by importing bibtex, either by manually copying or pasting, or I have a little Keyboard Maestro which grabs the bibtex that Google Scholar exposes and pastes it into Bibdesk. I then have a little script which simply autolinks the last downloaded PDF in Downloads to the currently selected publication in BibDesk. The script is here, it’s actually Ruby using a bridge to AppleScript (because I write much better in Ruby – I am sure it would be easy to write the whole thing in AppleScript as well).
This works reasonably well for me. I still wish Bibdesk would grab PDFs when importing from Google Scholar (or even let me download at all from the built in browser), or that zot2bib would also import the PDF, not just the citation.