Jane Dallaway

Jane Dallaway

Jane Dallaway  //  Data loving developer/leader/product shaper, storyline curator/creator, life-long learner, photographer, dog owner, reader, crafter, gardener and occasional snowboarder

This blog contains all sorts of odds and ends, from event reviews, stuff about my storyline project, bits of craft, through thoughts on learning, to photography stuff, and general inspiration things. It's a bit all over the place with no real theme, but then so am I!

Email: jane @ dallaway.com
Also at:    

Kindle: Getting the notes and highlights for a specific book into a text file

I've been making a lot of use of my Amazon kindle, but I was mildly annoyed that only annotations and highlights from Amazon purchased books end up on the kindle.amazon.com site.  After doing a bit of reading, I discovered that the highlights and annotations are stored in 2 places on the kindle itself.  Firstly embedded in the .mbp files that can be found in the Documents folder when the kindle is mounted, and secondly in the My Clippings.txt file, found in the same place.

The applications and scripts I found to query the mbp files seemed to only return the last few annotations/highlights, which wasn't what I wanted.  I found a few applications that were windows based, but couldn't find anything for the mac, so, I decided to roll up my sleeves and do battle with applescript to write something that did what I wanted.

What I wanted was :

  • To use the My Clippings.txt file so I got all the highlights/annotations
  • To produce a text file per book listing highlights and annotations ordered by location
  • Optionally add the location to the end of the highlight/annotation

I used a couple of my Wednesday afternoon's at home to write the script, learnt quite a lot about applescript in the process, and polished my swearing as I got more and more frustrated with applescript and myself.  

Originally I intended to spend some time refactoring and making it look prettier, but I've got it doing pretty much what I wanted, and having spoken to a few people, they thought it was probably useful as a starter for anyone else who wanted to do something similar.

So, I've added it to my downloads page and made it available here.  The usual disclaimer applies - use at your own risk.  If you refactor this to be prettier/more efficient I'd love to see the changes.

applescript editor

To use it:

  • Open the file in the applescript editor
  • Take a look at the code if you wish - I've tried to comment the methods etc
  • Run the code
  • A dialog will be displayed asking you to select your My Clippings.txt file - I've been copying this off the kindle and on to my desktop to ensure I can't destroy the original at all
  • A second dialog will be displayed asking you to select an output folder to put the text files in
  • A message box will be displayed asking you if you want to delete all files currently in the folder - the default is no
  • A message box will be displayed asking you if you want the location data appending to the end of a highlight/annotation - the default is yes
  • The script will then work through the My Clippings.txt file producing a text file per annotated/highlighted book (no bookmarks are output)
  • A final message box will be displayed telling you how many files it has output

Hope this script proves useful to someone.

4 comments

Feb 08, 2011
Jesse said...
This script was a lifesaver! I've been looking around for something like this tonight because I couldn't get the little app at http://willcodejavaforfood.com/my_clippings.html to work properly (I think it may have something to do with it being written for Kindle 2 and I have a Kindle 3). But this worked great with one caveat. I kept getting an error message about one of my book...the script couldn't create the txt file for it and then it couldn't find the text file to write in. I realized that the book had a colon in the title but that file names can't have colons, so it was giving me an error message. If you're interested, you may want to go in and add some code to take out an colons in book names. I manually went in, replaced any colons with spaces using find and replace, then ran the script and it worked beautifully. Thank you so much!
Feb 08, 2011
Jane Dallaway said...
Thanks for the feedback Jesse, I've updated the file and replaced : / \ characters in file names and put it back in the downloads area.
Mar 28, 2011
Dom said...
Thanks so much! Works perfectly.
Jun 14, 2011
Cyrus said...
Awesome awesome app man.. cannot tell you how useful this is going to be for me. If you lived in Dallas I would buy you a beer. Thanks again.

Leave a comment...