Identifying repeating tasks

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;
})();

I have solved the problem with the repetitive tasks (I have about 50 of them) quite easily. On the one hand, all repetitive tasks have a symbol f.e. “🔄 Change Britta water filter” at the start of the text. I have task templates for all types of tasks (e.g. with the emoji 🔄) and I only need to drag them into a project with the mouse and label them. In addition, repetitive tasks also get a tag “@ 🔄 REPEATING”. This would quickly solve your problem. This would make it easier to solve your problem without code. Access with a separate perspective is therefore feasible. However, this would require templates for tasks that already contain the symbols or the tag. For me, the recognizability of tasks with repetitions is important.

1 Like

Thank you for the suggestion, I didn’t think of using symbols, definitely that would help!

On the other hand, I wrote that script to quickly identify mistakes: often my repeating tasks are pretty complex, and by the time I finish adding all the details in the note, I forget to add the repeating rule, or I put them in the wrong project.

I run the script right after my weekly review, so I am sure to catch mistakes quickly.

If anyone from Omni is reading this: a perspective rule to select repeating (or non-repeating) tasks would be very helpful!