Electronic books (eBooks) are changing our way of reading books by providing us enhanced functionalities to interact with books. Amazon Kindle is one of the successful example of eBook servieces populated with millions of books. One of the notable functionality of Kindle is that readers can "highlight" the sentences in books and send the highlighted texts via email. While this enable users to easily export sections of the books, they need to manually organize their exported texts. Here I present a small Google Apps Script that automatically transfers the kindle annotations to Google drive. Given the search functionality of Google Drive, users can easily look up sections of books.
This Google Apps Script performs the following tasks: (1) checks your Gmail account; (2) identify email messages from Amazon Kindle service with your annotations (attachment files); and (3) save them to your google drive folder of your choice.
Note that some publishers has a maximum amount of highlights that can be exported via email. Given that this script just copies files from Gmail to Google Drive, it doesn't address this limit. You may browse the highlighted texts on Amazon's service: https://read.amazon.co.jp/notebook