BibDesk To LyX

I’ve been using LyX for a while now to write papers and my doctoral thesis. It’s a great WYSIWYM (What You See Is What You Mean) front-end to LaTeX. I’ve been using the Aqua version of LyX for the Mac and have found it indispensable.

While LyX has good BibTeX support for entering citations it’s always good to have tools to help manage a bibliography database for documents the size of a thesis.

Enter BibDesk. This is great Mac OS X tool for searching and managing your references. Unfortunately, it doesn’t have support for sending selected citations to LyX. Other BibTeX tools, such as the Java-based JabRef can do it, but I prefer BibDesk as it is a native OS X app.

With no prior knowledge of AppleScript I was able to quickly whip up a script that takes advantage of the AppleScript support within BibDesk and the neat unix pipe communication LyX uses to allow external programs to talk to it.

Download

Right-click and choose "Download Linked File"Anyone know how to have AppleScript files treated as binary so they are automatically downloaded when clicked? My contact details can be found on the about page. to save the script to your desktop.

  • SendToLyx.scpt for LyX version 1.36 to 1.6 and the upcoming version 2.0 - [2kb]

Installation

Like other BibDesk scripts BibDeskToLyX should be saved to your ~/Library/Application Support/BibDesk/Scripts/ directory. The next time you start up, the script should appear in the scripts menu of BibDesk.

Notes

Occassionally, the pipe to LyX can get messed up. When this occurs sending a BibDesk entry to LyX will cause BibDesk to freeze up. I'm not sure how to resolve this yet but the following steps have always fixed the problem for me:

  1. Shutdown LyX and BibDesk (using Activity Monitor to "Force Quit" if necessary).
  2. Delete the lyxpipe.in and lyxpipe.out files. These are in ~/.lyx/ in version LyX 1.36 and the directory named for the version of LyX you are using in ~/Library/Application Support/ for version 1.37 to 1.5.
  3. Restart LyX and BibDesk.

Thanks

Thanks to Bennett Helm for emailing me with a fix for LyX 1.3.6, providing a fix for LyX 1.4 and keeping the script up to date with LyX 1.6 and the upcoming version 2.0.

Thanks also to Philipp Schaer for providing me with an updated version of the script for LyX 1.6.

Licence

I have placed this script in the public domain under the Gnu General Public License. Keep in mind that, like most software, there is no warranty for this program. While it is incredibly unlikely, if things do happen to turn sour and, through the use of this script you lose a database, LyX document or arm, I do not take any responsibility

Last modified: 2008/12/09 14:24