Skip to content

Instantly share code, notes, and snippets.

@bramchi
Last active May 15, 2018 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bramchi/c7c3c20407081fc3eead413bbee4fd25 to your computer and use it in GitHub Desktop.
Save bramchi/c7c3c20407081fc3eead413bbee4fd25 to your computer and use it in GitHub Desktop.
Copy a Microsoft To-Do list from the webapp to your clipboard in plaintext
/*
Paste this in your javascript console at https://todo.microsoft.com
The texts will then land on your clipboard, so you can paste them into
another todo app like todoist, that will pickup multiple tasks based on the new lines
*/
var nodes = document.querySelectorAll('.taskItem-title');
var list = [].slice.call(nodes);
var innertexts = list.map(function(e) { return e.innerText; }).join("\n");
var dummy = document.createElement("textarea");
document.body.appendChild(dummy);
dummy.value = innertexts;
dummy.select();
document.execCommand("copy");
document.body.removeChild(dummy);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment