Importing Kindle Notes into DEVONthink Pro

After fighting with web clippings and research type information for a couple years, earlier this year I finally broke down and bought DEVONthink Pro Office 2.0.  While it may not be for everyone, I find that it’s particularly well suited for the type of research and reading I typically perform.  Therefore, all notes, quotes, and other miscellaneous information I’ve found online eventually makes it’s way into this huge database.  Once there, I can perform searches, and even better, let it find “related” items. While this works great for online media which I can easily copy and paste into DEVONthink, I was still at a bit of a loss for printed media such as books and magazines.

However, this Christmas I received an Amazon Kindle.  While not everything I read is available for the Kindle, I have thus far found that it’s an almost perfect tool for reading and note taking. What’s more, any highlighted passages and notes which are taken on the device are available online at http://kindle.amazon.com.  This was perfect — and I could copy and paste these quotes into DEVONthink.

But after a little looking, I found that Tim Wilson of TechnoSavvy.org had created an AppleScript web scraper which would take the Kindle notes off Amazon’s web page and import them into Evernote.  With a bit of modification, I’ve successfully modified it to work with DEVONthink.  This means that I can import my kindle annotations into DEVONthink to use later with a few clicks — no more copy and paste!

I don’t claim that it’s perfect, but it does seem to work just fine.  Below are instructions for setting it up.

Installation Instructions

  1. Download Tim Wilson’s NoteScraper for Evernote from here.
  2. Follow the included instructions to install NoteScraper for Evernote.
  3. Make a copy of the script ~/Library/Scripts/Applications/Safari/Export Kindles notes to Evernote and name it something like “Export Kindle Notes to DEVONthink Pro”
  4. Edit this new script by double clicking on it.  This will bring up the AppleScript Editor.
  5. Paste the text from the file below into the bottom of the script.
  6. Find the line “CreateEvernotes(NoteTextList, numNotes)” and replace with “addToDTP(NoteTextList, numNotes)”
  7. Enjoy!

Instructions for Use

To use this script, navigate to your Amazon Kindle Page and click on the “Your Books” link.  Click on one of the books titles and it should take you to a page with your annotations listed.  Once on this page, go to the AppleScript menu in your status bar (which was added by following the NoteScraper installation instructions) and select your new script named “Export Kindle Notes to DEVONthink Pro”.  Answer the prompts, and if all goes well, the currently selected database will then contain the new notes!

For some reason, it doesn’t appear that DEVONthink allows a script to choose which database to place the imported entries in.  Therefore, this script will use the currently selected database.

Downloads

By clicking the link below, you can download the latest version (whatever it may be) of the addToDTP script.  Use it by following the above instructions.  Please note – I developed this for my personal use.  I fully expect there to be glitches and bugs, but if you would be so kind as to leave a note below in the comments, I’ll do my best to try to help out and fix things.  Also note, there is no warranty of any kind associated with this.

Download addToDTP v0.3 (beta)

Changelog:

Version 0.3 (beta) -

  • Fixed a bug for short notes / hightlights (under 6 words) which would cause earlier versions of the script to hang (and never quit).

Version 0.2 (beta) –

  • Added progress meter popup when downloading notes into separate DEVONthink entries (moves pretty quick so you really won’t see it unless you have a LOT of notes).
  • Cleaned up some of the code

Version 0.1 (beta) – Original Release

9 thoughts on “Importing Kindle Notes into DEVONthink Pro

  1. Thanks for taking this on, Mark.

    I was not able to get it working fully. I clicked on the script in Safari and was prompted to select format and enter tags. Then nothing. Any thoughts?

    Since I pasted the code at the end of Tim’s original script, the Evernote piece is still active. Is this how it is supposed to be? Do you go direct from Kindle web to DevonThink?

    Thanks!

  2. Eric – Sorry to hear you’re having problems with it. I really have no one else to test it other than myself, so I do expect a few bugs! I’ve made a few updates and created a version 0.2 (and a subsequent v0.3) of the script so if you would be so kind as to try that, we’ll see if it fixes anything.

    The script should import directly from Kindle Web, to DEVONthink without any Evernote interaction. While the above instructions don’t remove the Evernote portion, Step 6 – “Find the line “CreateEvernotes(NoteTextList, numNotes)” and replace with “addToDTP(NoteTextList, numNotes)”” should disable the Evernote portion, and instead run the updated part you downloaded from here.

    The other thing to remember is that it will put the imports into the currently selected database in DEVONthink. For some reason, it doesn’t appear that DEVONthink allows AppleScript to select which database, so that’s the best I could do.

  3. Thanks for getting this together Mark. I can’t open the duplicated ‘Export Kindle notes to Evernote’ script as AppleScript Editor states that it is saved as run only. Any clues?

    Nick

  4. Nick – When you save a Script through the AppleScript editor, you are given an option to safe it as run only. If this option is checked it will cause the script to be saved in a non-editable format. I’m guessing that either your copy of the Evernote script (or the original) got saved with this option selected.

    I would suggest re-downloading the script from Tim Wilson’s site, make sure you can open it, and then selecting ‘Save As’, making sure the ‘Run Only’ option is not selected.

    For more info, see this link: http://www.tuaw.com/2008/01/13/applescript-saving-scripts/

    Hope this helps!

  5. Nick – I just tried re-downloading the scripts and was able to open them without any problem.

    Try this and see if it helps. Right click on This Link (a link directly to Tim Wilson’s Evernote Script) and select “Save As”. Place this file on your desktop. (It should actually be a zip file, which on my Mac will automatically unzip into a folder called “NoteScraper For Evernote”. Open this folder on your desktop and open the file “Export Kindle Notes to Evernote”. This should open in AppleScript Editor. From here, you should be able to select “Save As” and place it in the folder discussed in Step 3 of this post.

    Note: You will still have to follow Tim’s directions for installing his script as it requires an external library which he shows how to download in his readme file.

    Good luck!

  6. Mmmh. When I try right clicking your link and save as I get an html file called ‘Untitled’. When I click on the link itself I get the file in a folder but can’t open it (run only error).

    Is there any chance you could email me either your version of the script or the text from this script to nickharambee at me dot com (preferably both)?

    Thanks for your efforts to get this working…

  7. If you have trouble opening up the Evernote script, ensure that you have Evernote for Mac installed – the script editor attempts to open Evernote to get access to it scripting dictionary.

Comments are closed.