Hi. I’m not particularly familiar with AppleScript and have never used it to work with OF, but I’m trying to modify a Übersicht widget that shows flagged tasks to limit the output to only tasks which are available. Here’s the specific code for the function:
function getFlaggedTasks(){
taskList = [];
tasks = doc.flattenedTasks.whose({completed: false, flagged: true})();
var today = new Date();
tasks.forEach(function(task){
if ( (!task.deferDate()) || (today > task.deferDate()) ) {
context = (task.context() !== null) ? task.context().name() : '';
project = (task.container() !== null) ? task.container().name() : '';
taskList.push({
name: task.name(),
id: task.id(),
context: context,
project: project,
note: task.note(),
});
}
});
I’ve tried adding “available: true” in the line that has “doc.flattenedTasks.whose({completed: false, flagged: true})();” but that didn’t work.
Would someone be willing to help me out here? I’m also OK with chasing it down myself if someone can point me in the right direction.
Thanks!