Hi all,
This is my first post here, but I have been using OmniFocus since day 1: I would say even before, since I was using Kinkless in OmniOutliner before OF existed…
In my current workflow, I prefer to group all repeating tasks in specific projects, called “Recurring”. I have a recurring project in almost every folder, and I find it difficult to identify mistakes (recurring tasks in non-recurring projects, and vice versa) during my weekly reviews.
Unfortunately, there is no way to show only repeating (or non-repeating) items in a custom perspective, so I wrote a script to quickly identify all anomalies. I am sharing it here, in case it may be useful to others. JavaScript is not my native language, apologies for anything non-idiomatic or inefficient I may have put in there!
(() => {
var action = new PlugIn.Action(function(selection, sender) {
const recurring = projectsMatching("Recurring");
const non_recurring = projectsMatching("").filter(project => !recurring.includes(project));
let recurring_anomalies = "";
let non_recurring_anomalies = "";
console.log("Non recurring tasks in recurring projects");
recurring.forEach(project => {
project.tasks.forEach(task => {
if(task.taskStatus !== Task.Status.Dropped &&
task.taskStatus !== Task.Status.Completed &&
task.repetitionRule === null)
if(task.parent !== null && task.parent.repetitionRule === null) {
console.log(project.name, task.name, task.taskStatus);
recurring_anomalies += `${project.name} – ${task.name}\n`;
}
});
});
console.log("Recurring tasks in non recurring projects");
non_recurring.forEach(project => {
project.tasks.forEach(task => {
if(task.taskStatus !== Task.Status.Dropped &&
task.taskStatus !== Task.Status.Completed &&
task.repetitionRule !== null) {
console.log(project.name, task.name, task.taskStatus);
non_recurring_anomalies += `${project.name} – ${task.name}\n`;
}
});
});
let message = "All good!";
if(recurring_anomalies.length > 0) {
message = "Non recurring tasks in recurring projects:\n";
message += recurring_anomalies;
}
if(non_recurring_anomalies.length > 0) {
message += "\nRecurring tasks in non recurring projects:\n";
message += non_recurring_anomalies;
}
const alert = new Alert("Recurring anomalies", message);
alert.show();
});
return action;
})();