Action

Pick a Project and add to Things

Posted by tommertron, Last update 12 days ago

Pick a project from a list in a specified draft and send the title of the task to Things in the specified project. Anything below the title will show up as notes in the Things task.

To use, replace the UUID placeholder in the script with the UUID with your list of projects.

Thanks to the wonderful drafts community for helping with this!

Note - you will need a drafts list with exact names of your projects. I automatically run a keyboard maestro script once a day on my Mac to make sure this is updated. I’d suggest a similar set up if you use this with lots of Things projects, otherwise updating can get quite tedious.

Steps

  • script

    // get the real UUID value from (i) info for your draft with the list
    let d = Draft.find("UUID of Draft with project list");
    // split the draft into an array of lines...
    let list = d.content.split("\n");
    
    var selections = []
    
    // Loop to add each item to prompt selection. 
    
    for (let item of list) {
        selections.push(item)
    }
    
    var p = Prompt.create();
    
    p.title = "Pick a project";
    p.message = "What project is it for?"
    p.addSelect("project", "Project", selections, [], false)
    p.addButton("OK");
    
    var selected_proj = p.show();
    
    //paste selection to clipboard
    app.setClipboard(p.fieldValues["project"][0])
  • url

    template
    things:add?title=[[title]]¬es=[[body]]&list=[[clipboard]]
    useSafari
    false
    encodeTags
    true

Options

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