Thursday, May 02, 2013

Kindle - how to remove (easily) items from personal documents

If you, like me, have a lot of "personal documents" in your Amazon library, you know how difficult it can be to remove items from that list.
You have to remove titles one by one, or - if you are fast enough - two or three of them for each try.
Now, this is really annoying.

Enter javascript and bookmarklets...

Below you will find some javascript code that can be used to remove all the items you see on a particular page. In the Amazon Kindle Library page you will have to select "Personal Documents" from the drop down list (otherwise the bookmarklet won't work), and enter a search term in the search textbox, in order to limit the deletion only to the items you really want to delete. This is important, as the javascript will kill ALL the docs you see in the page... ok?

Before you can use the bookmarklet, you'll have to create it. In Chrome this is quite easy:
- right click on the bookmarks bar
- click on "Add Page"
- enter a title for the page name
- paste the javascript code in the "URL" field

That's all: be careful to select only the items you really want to delete, click the bookmarklet you created, and all those documents will go... forever!!!

javascript:(function(){ var v = new RegExp("PersonalDocuments"); if (!v.test(document.URL)) { return false; } {a=document.getElementsByClassName('rowBodyCollapsed');for(var i = 0; i<a.length; i++){Fion.deleteItem('deleteItem_'+a[i].getAttribute('asin'));};return; }})();