|||

The best of both worlds: One-click reference metadata for Bookends with Zotero

Download the Keyboard Maestro macro

Download the Import to Bookends Hazel Rule

Update — Oct 28, 2020: I fine-tuned the workflow a bit and have updated the instructions, the KM macro, and the Hazel Rule to suit.

TL;DR: Use the Keyboard Maestro macro and Hazel rule above to use Zotero as an effortless inbox for Bookends. See the instructions.

Bookends is a truly excellent reference manager. It is sturdily engineered, handling thousands of references with effortless speed. It’s stupidly flexible and powerful, giving the user lots of control over how references are organized, how to use reference metadata and attachments, and how to find new references. Its tagging system integrates with macOS tags, so organizing schemes interoperate. And it’s across all Apple platforms: you can sync up your references on iPhone and iPad, just in case you’re having trouble remembering exactly which paper to use to assert your intellectual superiority at that party.

However, as I pathetically whined about on Bookends’s support forum earlier this year, the import workflow simply can’t compete with another popular reference manager: Zotero. Bookends handles some scholarly sources relatively quickly and effectively, but everything else is pretty much completely manual.

Here’s a GIF roughly comparing the process: A video demonstrating showing the speed of importing in Zotero vs. Bookends.

Zotero is a mostly-free open-source reference manager. It can be extended with a variety of community-built plugins. That same awesome community provides all kinds of resources to help you format your reference list for that niche publication. But the real magic1 of Zotero is its importing process: install its browser extensions and in one click you can get near-perfect reference metadata from virtually any resource on the Internet.

I mean it. It handles journals, blogs, podcasts, and even YouTube with aplomb. You should usually double- and triple-check what it grabs, as there’s usually additional metadata you can add.2

However, Zotero’s a non-native app. It doesn’t perform quite as well as Bookends when handling many references. It doesn’t have deep OS integrations like tags and AppleScript functions.

These tradeoffs have caused me a lot of conflict over the past year or two. I wanted the benefits of organizing in Bookends, but I wanted the frictionlessness of obtaining references through Zotero.

Well, recently, that conflict led me to adding a new task to my daily plan:

  • [ ] Switch from Bookends back to Zotero.

And sometimes, on the Internet, it’s the littlest of interactions that make your day.

Through happenstance, on the Obsidian forum, someone asked for an example of something, so I shared a screenshot of my daily note, including that task item.

A curious colleague messaged me about it. Joel (or @AutonomyGaps on the Obsidian forum/Twitter) and I chatted back and forth about Bookends vs. Zotero, the opportunity of automating the chasm between them, and our own failures to do so. I had figured out a way to use Keyboard Maestro to quickly export your library of references from Zotero, but couldn’t figure out how to easily get them into Bookends. Joel had figured out that Hazel could grab Zotero-exported .ris files to import into Bookends, but couldn’t figure out how to get them out of Bookends easily.

…See what happened?

It turns out that you can use Zotero as an “inbox” for Bookends!

Here’s how it works:

Use Zotero as an inbox for Bookends

Requirements

  • Keyboard Maestro, Hazel, Bookends, and Zotero
  • Zotero must be kept empty: the workflow exports all references from your Zotero library each time you run it
  • The Bookends Import Filter must be set to RIS.filtr (see step 1)
  • The Zotero Export Library settings must be using the RIS format, have Export Files enabled, and have Unicode (UTF-8) set as the character encoding (see step 2)
  • There must be a folder called “My Library” on your desktop (see step 4; ⚠️ Make sure you’re not using a My Library desktop folder for anything else! ⚠️)

Instructions

  1. In Bookends, open the Import References dialog (File → Import References → From File or Clipboard…). Click the “Import references using…” drop-down menu and select RIS.filtr.
  2. In Zotero, open the Export Library dialog (File → Export Library…). Select RIS from the Format: drop-down menu, enable the Export Files option, and set the Character Encoding: drop-down menu to Unicode (UTF-8).
  3. In Hazel’s preferences pane, add your Desktop to the list of folders you can apply rules to. (Click the + in the bottom-left, navigate to your desktop/select your desktop folder, and hit Open).
  4. Download the Keyboard Maestro (KM) macro and the Import Into Bookends and Drill down Hazel rules and install them by double-clicking on the files. When prompted by Hazel, select the Desktop folder.
  5. Create a folder titled “My Library” on your desktop.
  6. Download a set of references into Zotero using its browser extension. Marvel at the metadata you didn’t need to type in yourself (but make sure it’s all correct).
  7. Initiate the Keyboard Maestro macro (e.g., you can open Keyboard Maestro, select the macro, and click “Run,” or you can set triggers of your own preferences, such as by setting up a keyboard shortcut for it).
    • The macro exports your Zotero library and files as a .ris file, and saves it to a folder on your desktop titled “My Library”.
  8. Hazel will automatically open the .ris file into Bookends, importing all of your references and any associated PDFs.

Magic!3

Here’s what it looks like, using one of Joel’s paper’s as a demo (one I might actually read! 😉): A GIF showing the automation in full

Here’s what the Keyboard Maestro macro does in detail:

A screenshot of the Keyboard Maestro macro

  • First, to make sure Hazel picks up the new files, it deletes everything from the My Library folder on your desktop. (⚠️ Make sure you’re not using a My Library desktop folder for anything else! ⚠️)
  • It activates Bookends, to make sure the app is ready to receive the files later. (My Bookends library takes so long to load that Hazel gets confused if it isn’t already open.)
  • It activates Zotero, to switch back to the app.
  • It launches Zotero’s Export Library… File menu action. Then, it uses keystroke emulation to:
    • Confirm the export library dialog;
    • Jump the dialog to the desktop (cmd+d on any Choose File modal on macOS);
    • Confirms the export name (My Library);
    • Confirms that you want to replace your existing My Library desktop folder (cmd+r, since the “Replace” button begins with R. This is a trick that generally works on any macOS dialog box.);
    • Pushes a notification to confirm the whole thing ran (and to remind you to clear out Zotero after it’s done.

Note: You might want to tune the timing of delays in the KM macro—depending on your computer, you may need to slow things down to make them run properly, or faster durations might work just fine.


  1. As with all other kinds of magic, this is actually the result of smart people putting in a lot of effort.

  2. This is always true, though, isn’t it?

  3. Not that I claim intelligence, but this again is not actual magic, just months of guessing and checking…

    Next → Why and how to use Obsidian and NotePlan together ← Previous Distraction Deterrent
    Latest posts
    → Cross-post: Intuition is confident abductive-inferential thinking
    → Note titles as API calls
    Why and how to use Obsidian and NotePlan together
    The best of both worlds: One-click reference metadata for Bookends with Zotero
    Distraction Deterrent
    Today’s Plan: A shortcut for planning your day with a text-based list and Fantastical
    DEVONsave: A shortcut to help you clip websites to DEVONthink To Go quickly and cleanly
    Fulcra → A turn of events
    Systemics and design principles in support of Tiago Forte’s PARA framework