Repeating Tasks

Omni Automation in OmniFocus (v3.8+) provides the ability to set the repetition rules for a task. The repetitionRule property of the Task class is used to access and set any repeating parameters.

The Task.RepetitionRule Class

A Task.RepetitionRule describes a pattern of dates using a ICS formatted recurrence string ( and a Task.RepetitionMethod to describe how those dates are applied to a Task.

The properties of the Task.RepetitionRule class:

The Task.RepetitionMethod Class

var task = new Task("My Weekly Task") var ruleString = "FREQ=WEEKLY" task.repetitionRule = new Task.RepetitionRule(ruleString, Task.RepetitionMethod.DueDate) var taskID = URL.fromString("omnifocus:///task/" + taskID).open()

And to disable repetition, set the property value to null:

var task = taskNamed("My Weekly Task") task.repetitionRule = null

The Rule Info Plug-In

Aside from using the free RRULE Tool at, perhaps the simplest way to derive an ICS rule string is to set up an example repeating task in OmniFocus using the standard application interface, and then use Omni Automation to retrieve the corresponding ISC rule string from the selected task. You can then use the extracted ICS rule string in your scripts to define the specified repetition parameters.

The plug-in provided below will both display the ICS string and log it to the console for you.

/*{ "type": "action", "targets": ["omnifocus"], "author": "Otto Automator", "identifier": "com.omni-automation.of.task-rule-info", "version": "1.1", "description": "This action will display an alert showing the ICS rule string and repetition method of the selected task or project.", "label": "Rule Info for Selected Item", "shortLabel": "Rule Info" }*/ (() => { var action = new PlugIn.Action(function(selection, sender){ // action code // selection options: tasks, projects, folders, tags if (selection.projects.length === 1){ var item = selection.projects[0] var alertTitle = "Project: " + } else { var item = selection.tasks[0] var alertTitle = "Task: " + } var rule = item.repetitionRule var ruleString = item.repetitionRule.ruleString var repetitionMethod = item.repetitionRule.method var msg = "" var methodName switch(repetitionMethod) { case Task.RepetitionMethod.DueDate: methodName = "Due Date" break; case Task.RepetitionMethod.Fixed: methodName = "Fixed" break; case Task.RepetitionMethod.DeferUntilDate: methodName = "Defer Until Date" break; default: methodName = "None" } msg = "ICS Rule String: " + ruleString + "\n" + "Repetition Method: " + methodName console.log(msg) new Alert(alertTitle, msg).show() }); action.validate = function(selection, sender){ // validation code // selection options: tasks, projects, folders, tags return ( selection.projects.length === 1 && selection.projects[0].repetitionRule != null || selection.tasks.length === 1 && selection.tasks[0].repetitionRule != null ) }; return action; })();