BibDeskAppleScripts icon indicating copy to clipboard operation
BibDeskAppleScripts copied to clipboard

BibDesk Applescripts to download PDFs and fill in info

#+OPTIONS: toc:3

  • DEPRECATED

This project should be considered deprecated.

As of BibDesk v.1.6.7, BibDesk has native support for importing via DOI.

#+BEGIN_html




#+END_html
  • Some BibDesk Apple Scripts

** bibfetch.pl.scpt

This script does the following:

  1. For each selected BibDesk publication
  2. Passes the DOI if available or the quoted Title if no DOI to bibfetch.pl
  3. Parses the results of bibfetch.pl for the URL of the PDF
  4. Uses curl to download the PDF
  5. Attaches the PDF to the publication
  6. Auto-files the PDF

** pdfmeat.py.scpt

This version takes one or more selected BibDesk records and fills in missing information using Google Scholar search. If a DOI or title exists in the record, it searches Google Scholar with pdfmeat.py. If a PDF exists and no title, it uses pdfmeat to parse the PDF and then searches Google Scholar.

Various fields returned by the search are filled in to each existing record. Nothing is overwritten.

** Installation

*** BibFetch

1. Install [[https://github.com/mankoff/bibfetch][bibfetch.pl]] (my version) by downloading and putting
   somewhere, for example =~/bin= or =~/local/bibfetch/= 
2. Run it with =/path/to/bibfetch.pl --pdf --doi DOI= or
   =/path/to/bibfetch.pl --pdf "Title of Paper"=. It will probably
   crash, with an error message, at the top mentioning missing
   packages.
3. Install all of the dependencies it needs by typing something
   similar to the following at the shell prompt:
   #+BEGIN_SRC perl
   cpan install App::cpanminus
   # and then
   cpanm Foo::Bar
   #+END_SRC 
   You might need to use "sudo" before cpan and cpanm

4. When step (2) above works (a BibTeX record and link to PDF file
   is returned), you know bibfetch.pl is working

5. Put the =Bibfetch.pl.scp= in =~/Library/Application
   Support/BibDesk/Scripts=

6. Edit it, customizing the path at the top to where your
   =bibfetch.pl= script is located.

7. Test it from within BibDesk.

8. Assign a shortcut key to run it easily from the keyboard.

*** pdfmeat

1. Install [[https://github.com/mankoff/pdfmeat][pdfmeat]] (my version) by downloading and putting
   somewhere, for example =~/bin= or =~/local/pdfmeat/= 
2. Run it with =/path/to/pdfmeat.py --PDF /path/to/PDF=. It will
   probably crash, with an error message, at the top mentioning
   failed import statement
3. Install all of the dependencies it needs by typing something
   similar to the following at the shell prompt:
   #+BEGIN_SRC python
   pip install foo
   # or
   easy_install foo
   #+END_SRC 
   You might need to use "sudo" before =pip= or =easy_install=
4. pdfmeat makes use of cookies to access Google Scholar, so you
   need to launch FireFox once, go to Google Scholar, and set
   preferences so that BibTeX records are returned when you search
   on Google Scholar.
5. When step (2) above works (a BibTeX record is returned),
   you know pdfmeat.py is working

6. Put the =pdfmeat.py.scp= in =~/Library/Application
   Support/BibDesk/Scripts=

7. Edit it, customizing the path at the top to where your
   =pdfmeat.py= script is located.

8. Test it from within BibDesk.

9. Assign a shortcut key to run it easily from the keyboard.

**** Troubleshooting

If you search too often, Google Scholar will think you are a robot. In this case pdfmeat will return strange errors. Log in with FireFox and enter the CAPTCHA to convince Google Scholar you are human, and then remove the ".pdfmeat*" files in =/tmp/=.