Action

GoodTask Subtasks

Posted by @brentacPrime, Last update almost 6 years ago

Creates a NON-dated task in Reminders. If you use the app GoodTasks this will create a tasks with sub tasks. The first line is the title of the task with the remainder lines being the sub tasks.

An earlier version of this took the entire draft and popped it into a Workflow to finish the task creation. If you prefer that simply disable the script action and enable the workflow one.

Updated to add a link to the draft in the Notes of GoodTask

The required workflow: https://workflow.is/workflows/929b5259c3a04f06be59a032324cdf8f

Steps

  • runWorkflow

    workflowName
    GoodTask Sub tasks
    waitForResponse
    false
  • script

    var p = Prompt.create();
    
    //put the name of your lists here in replace of Reminders, Whenver, or add addtitional 
    p.addButton("Reminders");
    p.addButton("Whenever");
    
    var didSelect = p.show();
    var Choice = p.buttonPressed
    
    var taskPrefix = "..gt3[{\"Subtasks\":[";
    var taskSuffix = "]}]gt3";
    var itemPrefix = "\"0";
    var itemSuffix = "\"";
    
    var UUID = draft.processTemplate('[[uuid]]');
    var link = "drafts5://open?uuid="+UUID;
    var body = draft.processTemplate('[[body]]');
    var lines = body.split("\n");
    var array = [];
    for (var line of lines){
    var item = itemPrefix + line + itemSuffix;
    array.push(item);
    };
    var subtasks = taskPrefix + array + taskSuffix;
    
    var list = ReminderList.findOrCreate(Choice);
    var reminder = list.createReminder();
    reminder.title = draft.processTemplate('[[title]]');
    reminder.notes = link+subtasks
    reminder.update();

Options

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