How do I collect all of my notes and highlights from iBooks? I've got a lot of highlighting and notes in iBooks that I've read, and would like to be able to collect them in one easy to use and manipulate format (e.g for writing papers and citing quotes). 

For example, I'd like a highlight like this



to produce something (e.g., in CSV) like 


  Quod me nutrit me destruit – that which sustains me also destroys me,14,Tamburlane Parts One and Two,Christopher Marlowe,Anthony B. Dawson ed.,Bloomsbury,https://itun.es/us/qSrZ0.l


I can see how to do this (sort of) laboriously, one note at a time, using iBook's "sharing" feature (or copy and paste, of course) but I don't see any way to do it in bulk, for all of my notes from a book, or even all my books.

Is there a way to accomplish this, with an Apple Script or using Automator for example? Or perhaps there is a text or XML file containing my notes and highlighting that I could write a script (in Python, preferably) to parse.
iBooks doesn't have AppleScript support.  The annotations are stored in a SQLite file: ~/Library/Containers/com.apple.iBooksX/Data/Documents/AEAnnotation/.

You could try to parse that. This answer gives a link to Digested, which reads that database and then allows you to export your annotations to Evernote, but I don't know what formatting they'll have or if you want to mess with Evernote.

One (possibly) simple solution would be to open the book in iBooks for iOS. You could then email the annotations in bulk to yourself. 


Open the book
Press the "list button" to bring up the Table of Contents
Switch to the Notes tab
Press the Share button
Select Edit Notes
Select All
Share via email.




Edit:

Actually, after reading a comment on reddit, there seems to be a way to export them all from iBooks on OS X as well:


  You can export your notes in an email from Notes -> Select All -> Share (you need to hold ctrl while you right click to retain your selection). Your highlighted portions will be copied into the email with your notes and formatted nicely.
  Strangely, on the Mac the application doesn't care about whether the book is copy protected—it will always copy the highlighted portion. The iOS application indeed discriminates though. If your book is copy protected, then only the chapter name will be shared.
  That seems to be the only way to do it unfortunately. :/


Using my laptop's trackpad, I had to hold down ctrl + shift while tapping on the trackpad in order to bring up the contextual menu while retaining the selection.