Skip to content

Instantly share code, notes, and snippets.

@weynhamz
Created June 9, 2017 18:25
Show Gist options
  • Save weynhamz/9772fde19abc65e4ce08e6c73f3f27db to your computer and use it in GitHub Desktop.
Save weynhamz/9772fde19abc65e4ce08e6c73f3f27db to your computer and use it in GitHub Desktop.
A snippet of javascript runs in the console that exports the workflowy content to todo.txt format
function get_name(h) {
if (h.getParent().getProjectId() != 'None') {
var p = get_name(h.getParent());
return p + ' > ' + h.getName();
} else {
return h.getName();
}
}
jQuery('.bullet').each(function () {
var h = project_tree.getProjectReferenceFromDomProject($(this).getProject());
var n = '';
if (h.isCompleted()) {
n = 'x';
var v = new Date(h.getCompletedDateString());
n = n + ' ' + v.toISOString().slice(0, 10) + ' ';
}
var y = new Date(h.getLastModifiedDateString());
n = n + y.toISOString().slice(0, 10) + ' ' + get_name(h);
console.log(n);
if (h.getNote()) {
console.log('# ' + get_name(h));
console.log(h.getNote());
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment