Last active
May 15, 2018 17:25
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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