Skip to content

Instantly share code, notes, and snippets.

Last active May 22, 2024 16:09
Show Gist options
  • Save vedant/9333992 to your computer and use it in GitHub Desktop.
Save vedant/9333992 to your computer and use it in GitHub Desktop.
Export note files from Google Keep
/* Vedant Misra ( (
* 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 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="//";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){,n){if(!t){e.error(" 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.href=window.URL.createObjectURL(r);s.dataset.downloadurl=["text/text",,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"');[1].innerText,n[r].innerHTML+".txt")}alert(t.length-1+" files downloaded.")})})()
Copy link

ghost commented Oct 10, 2014

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

Copy link

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.

Copy link

Doesn't work for me. Says Error 400

Copy link

einichi commented Dec 5, 2019

Quickly hacked this together since this script no longer seems to work:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment