Action

Prompt ⇢ Todoist

Posted by @nahumck, Last update over 5 years ago - Unlisted

Send a single task to Todoist.

Steps

  • script

    /* --- Add Todoist Task via Prompt --- */
    
    // If text is selected, use as task name
    // Otherwise, leave it blank
    var sel = editor.getSelectedText()
    if (sel.length == 0) {
    	var task = "";
    }
    else {
    	var task = sel;
    }
    
    /* ---- Prompt ---- */
    var p = Prompt.create();
    p.title = "Task to Todoist";
    p.addTextField("task", "Task", task,{"placeholder":"task w/ date, priority, project, etc.","wantsFocus":true});
    p.addTextView("note", "Note", "", {"height": 50});
    p.addButton("Send to Todoist");
    var con = p.show();
    
    if (con) {
    	let todoist = Todoist.create();
    	todoist.quickAdd(p.fieldValues["task"], p.fieldValues["note"]);
    }
    else {
    	context.cancel();
    }

Options

  • After Success Nothing
    Notification Info
    Log Level Error
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.