2Do Tasks

Posted by RosemaryOrchard, Last update almost 6 years 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
    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 =;
    	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
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.