Skip to content

Instantly share code, notes, and snippets.

@anstosa
Created September 23, 2018 23:12
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 anstosa/331149d5fd70f2c49cf00340677a5176 to your computer and use it in GitHub Desktop.
Save anstosa/331149d5fd70f2c49cf00340677a5176 to your computer and use it in GitHub Desktop.
JS to uncheck all items in a TickTick list. Copy and paste into bookmark URL field
javascript: (() => {
function uncheckAll() {
const completedCheckboxes = document.querySelectorAll('.completed .t-check');
console.log(completedCheckboxes);
completedCheckboxes.forEach((checkbox) => checkbox.click());
}
const showMoreButton = document.querySelector('.show-more');
if (showMoreButton.style.display === 'none') {
uncheckAll();
}
else {
showMoreButton.click();
let completedTasks = document.querySelectorAll('.completed .task');
const waitForLoad = setInterval(() => {
const completedTasks = document.querySelectorAll('.completed .task');
if (5 < completedTasks.length) {
clearInterval(waitForLoad);
uncheckAll();
}
});
}
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment