Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Export note files from Google Keep
/* Vedant Misra (vedantmisra.com) (github.com/vedant)
*
* Script for exporting Google Keep note files.
*
* This does not handle attachments or checklists, only note files. Downloads
* each note to a .txt file named for the note's title.
*
* To use this, go to https://drive.google.com/keep/ and wait for the page to
* fully load all of your saved notes; scroll to the bottom to confirm they're
* loaded. Then paste the below in your URI bar, go to the start of the line,
* prepend what you pasted with "javascript:" without quote marks, and hit enter.
*
* REVISED for Google Keep update. 2014-09-14
*/
(function(){"use strict";var e=document.createElement("SCRIPT");e.src="//code.jquery.com/jquery-latest.min.js";e.type="text/javascript";document.getElementsByTagName("head")[0].appendChild(e);var t=function(e){if(window.jQuery){e(jQuery)}else{window.setTimeout(function(){t(e)},100)}};t(function(e){(function(e){e.save=function(t,n){if(!t){e.error("Console.save: No data");return}if(!n){n="console.txt"}if(typeof t==="object"){t=JSON.stringify(t,undefined,4)}var r=new Blob([t],{type:"text/text"}),i=document.createEvent("MouseEvents"),s=document.createElement("a");s.download=n;s.href=window.URL.createObjectURL(r);s.dataset.downloadurl=["text/text",s.download,s.href].join(":");i.initMouseEvent("click",true,false,window,0,0,0,0,0,false,false,false,false,0,null);s.dispatchEvent(i)}})(console);var t=e(".IZ65Hb-YPqjbf.h1U9Be-YPqjbf"),n=e(".IZ65Hb-YPqjbf.r4nke-YPqjbf");for(var r=1;r<=t.length;r++){t[r].click();var i=e('.IZ65Hb-YPqjbf.h1U9Be-YPqjbf[contenteditable="true"');console.save(i[1].innerText,n[r].innerHTML+".txt")}alert(t.length-1+" files downloaded.")})})()
@ghost

This comment has been minimized.

Copy link

commented Oct 10, 2014

With the new DOM changes, the script may require some changes. Kindly consider. Thanks.

@forkwhilefork

This comment has been minimized.

Copy link

commented Nov 15, 2014

yeah, this isn't working for me exactly. it downloads one of my notes and names it the title of a different note. seems to be close though.

@mayurjobanputra

This comment has been minimized.

Copy link

commented Feb 1, 2015

Doesn't work for me. Says Error 400

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.