I have been trying to figure out a script to have a report of tasks with same context. For example all tasks that have @ email together and same with @phone etc. This would allow for good GTD implementation and focus on one context. I do at the moment but via copy and paste into new file which is a pain.
Ideally, the report would look like this
email :
- task 1 @email @high (project …)
- task 2 @email @low (project …)
phone :
- task 3 @phone @today (project …)
- task 4 @phone @… (project …)
and so on.
I would appreciate it very much if someone can assist.
I have been using the following script which is good for one task but can it be used to create the report above ?
(() => {
'use strict';
// main :: IO ()
const main = () => {
const ds = Application('TaskPaper').documents;
return 0 < ds.length ? (
ds.at(0).evaluate({
script: tp3Context.toString(),
withOptions:
{
itemPath: '//@email and not @done'
}
})
) : 'No documents open in TaskPaper'
}
// ----------------- TASKPAPER CONTEXT -----------------
const tp3Context = (editor, options) => {
editor.itemPathFilter = 'except //*';
editor.outline.evaluateItemPath(
options.itemPath
).forEach(
x => editor.forceDisplayed(x, false)
);
return options.itemPath;
};
return main();
})()