Skip to content

Instantly share code, notes, and snippets.

@doug4j
Last active January 1, 2019 16:57
Show Gist options
  • Save doug4j/f370740cbe3346d8be942b63409f8c9e to your computer and use it in GitHub Desktop.
Save doug4j/f370740cbe3346d8be942b63409f8c9e to your computer and use it in GitHub Desktop.
//Modified from https://discourse.omnigroup.com/t/creating-a-new-task-with-javascript-for-automation-jxa/22393/2
var app = Application('OmniFocus');
app.includeStandardAdditions = true;
var doc = app.defaultDocument;
var newTask = app.InboxTask({
name: 'sample task',
note: 'a note',
});
app.quickEntry.inboxTasks.push(newTask);
app.quickEntry.save(); //Non-Interactive
//app.quickEntry.open(); //Interactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment