New plugin: Apple Books - Import Highlights

Hello community!

I’m happy to announce my contribution to the Obsidian plugins ecosystem - Apple Books - Import Highlights.

This plugin imports your highlights and passages from Apple Books to Obsidian.

Preview

The idea is not new, but this plugin has significant advantages over existing solutions:

  • Fast: It takes less than 1 second to import ~1000 highlights.
  • Customizable: Use Handlebars and Markdown to customize the output of your highlights the way you want. All the variables to use are available in the default template.
  • Reliable:
    • Import actual highlights with only the metadata you need. No visual noise with the deleted but still exported highlights, or, on the contrary, highlights and notes that make no sense without the context.
    • Back up your highlights before each import to avoid accidental data loss (optional, but recommended).
  • Dataview-ready: The default template creates highlights in a format that is compatible with Dataview, so you can use your highlights in Dataview queries to unleash possible use cases even further (for example, to create a list of books you’ve read).
  • Up-to-date: The plugin is updated regularly to support the latest versions of Obsidian, and Apple Books, as well as react to the users’ feedback.

How to use

  • Command palette: Cmd+P > Apple Books - Import Highlights: Import all highlights
  • Ribbon: Select the plugin icon in the Ribbon (left sidebar)

Side Notes

  • The only supported platform to perform import is macOS.
  • Currently, the plugin imports all highlights from all books in bulk. Importing highlights from a specific book is the major feature of the upcoming release.

Contributing

Your feedback and ideas are more than welcome and highly appreciated! Let’s have a discussion here!

In case of any issue, feel free to open an issue on GitHub

4 Likes

Nice work. This is really quick.

Is there a list of template variables that can be used to customise how the information is formatted?

Hi @cmyplay Thank you, I’m happy that you have a pleasant experience with the plugin. And thanks for your patience.

All the variables are available in the default template. It is mentioned in the documentation, but adding them explicitly would also be helpful. I will add it in the upcoming release. Thank you for the suggestion.

P.S: If you’ve already modified the template, you can back to the original one via “Reset template”.

UPD: @cmyplay You can find the full list of variables in the Template variables section of the README.

Had a thought considering you’ve just added the ability to import highlights of a specific book.

It might be of use to have the option (maybe a setting toggle) to be able to choose the order in which the highlights appear.

Some use cases that come to mind:

  • by Creation Date
  • by Last modified
  • sequentially in the book

Pushing this even further, if used regularly, it might be useful to have different templates (layouts) for each use case.

In which case, keeping the one default as is, perhaps each sort option could have a text field assigned to use a specific_template.md from the vault?

That’s yet another good feature request! Please submit an issue so we can align on expectations. Thank you!

It wouldn’t let me. That’s why I came here :slight_smile:

An owner of this repository has limited the ability to open an issue to users that are collaborators on this repository.

Damn, sorry about that :pensive: I modified the settings, you should be able to submit issues now.

HI, I just installed the plugin, which seems perfect for my needs, but I obviously got this error message, whatever vault and setup I try : Error while importing Apple books highlights.
Check console for details.

Have you heard of this issue ? Do you know how to overcome it ?

Thanks !

Hi, thanks for your interest in the plugin and sorry that your first experience wasn’t perfect. Let’s try fix this.

  1. Open your Obsidian vault where you want to use the plugin
  2. Press Command + Option + I to show the Developer Tools (or use app menu: View > Toggle Developer Tools).
  3. In the Developer Tools, select the Console tab
  4. Try to import highlights using the plugin.
  5. Copy here (or attach a screenshot) the error that you’re getting

Hi, thanks for reply. This is what I get in the console when trying to import highlights.

I get the same error.

@schiz0idandr0id @jdugarte Thanks for the feedback.
Please go to the plugin repo and submit a bug report, as I couldn’t easily reproduce the issue using the latest version of the plugin.
Thank you.