Drafts Action Directory

Prompt ⇢ Todoist

Posted by @nahumck, Last update 26 days ago - Unlisted

Send a single task to Todoist.

Install

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
Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.