2Do Tasks

Posted by RosemaryOrchard, Last update over 1 year ago

This action takes the each line of the current Draft and adds them to 2do as a separate note.


  • script

    // See online documentation for examples
    // http://getdrafts.com/scripting
    const baseURL = "twodo://x-callback-url/add";
    var tasks = draft.content.split("\n");
    for (var task of tasks) {
    	// create and configure callback object
    	var cb = CallbackURL.create();
    	cb.baseURL = baseURL;
    	cb.addParameter("task", task);
    	// open and wait for result
    	var success = cb.open();
    	if (success) {
    		console.log("Task created");
    	else { // something went wrong or was cancelled
    	  	if (cb.status == "cancel") {
    		else {


  • After Success Default
    Notification Info
    Log Level Info
Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.