I found it a little long-winded to import PDFs from the web into my BibDesk library. My old workflow was as follows:

  1. Open the PDF in my browser.
  2. Choose “Save Page as…” from the menu bar, and save the PDF to my desktop.
  3. Open BibDesk.
  4. Drag the PDF from my desktop into my BibDesk library.
  5. Edit the title/author etc. of the new publication.
  6. 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:

  1. Copy the URL of the PDF file.
  2. Launch the AppleScript below (a keyboard shortcut can be configured for this).
  3. Paste the URL.
  4. 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
About these ads

Comments on: "Adding PDFs to BibDesk" (1)

  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. :)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: