Skip to content

Instantly share code, notes, and snippets.

@doug4j
Last active January 1, 2019 16:57
Show Gist options
  • Select an option

  • Save doug4j/f370740cbe3346d8be942b63409f8c9e to your computer and use it in GitHub Desktop.

Select an option

Save doug4j/f370740cbe3346d8be942b63409f8c9e to your computer and use it in GitHub Desktop.

Revisions

  1. doug4j revised this gist Jan 1, 2019. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions of3-add-task-to-inbox.js.scpt
    Original file line number Diff line number Diff line change
    @@ -1,3 +1,5 @@
    //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;
  2. doug4j revised this gist Jan 1, 2019. 1 changed file with 2 additions and 4 deletions.
    6 changes: 2 additions & 4 deletions of3-add-task-to-inbox.js.scpt
    Original file line number Diff line number Diff line change
    @@ -4,9 +4,7 @@ var doc = app.defaultDocument;
    var newTask = app.InboxTask({
    name: 'sample task',
    note: 'a note',
    //context: 'work',
    //deferDate: somedate
    });
    app.quickEntry.inboxTasks.push(newTask);
    app.quickEntry.open();

    app.quickEntry.save(); //Non-Interactive
    //app.quickEntry.open(); //Interactive
  3. doug4j revised this gist Jan 1, 2019. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions of3-add-task-to-inbox.js.scpt
    Original file line number Diff line number Diff line change
    @@ -2,10 +2,11 @@ var app = Application('OmniFocus');
    app.includeStandardAdditions = true;
    var doc = app.defaultDocument;
    var newTask = app.InboxTask({
    name: 'sample task',
    note: 'a note',
    //context: 'work',
    //deferDate: somedate
    name: 'sample task',
    note: 'a note',
    //context: 'work',
    //deferDate: somedate
    });
    app.quickEntry.inboxTasks.push(newTask);
    app.quickEntry.open();

  4. doug4j created this gist Jan 1, 2019.
    11 changes: 11 additions & 0 deletions of3-add-task-to-inbox.js.scpt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    var app = Application('OmniFocus');
    app.includeStandardAdditions = true;
    var doc = app.defaultDocument;
    var newTask = app.InboxTask({
    name: 'sample task',
    note: 'a note',
    //context: 'work',
    //deferDate: somedate
    });
    app.quickEntry.inboxTasks.push(newTask);
    app.quickEntry.open();