Action

add predefined tag

Posted by FlohGro, Last update almost 6 years ago

You can add a predefined Tag to the currently draft with this Action.

I just defined the three tags „todo“, „done“ and „somedaymaybe“ to illustrate how this works.
If you need more Tags, just add more buttons to the prompt and more „else if“ conditions.
Of course you can change Tag tag names, too.
Make sure to change every string with the same Name to dont run into errors.

Steps

  • script

    var p = Prompt.create();
    p.title = "add tag";
    p.message = "which one?";
    p.addButton("todo");
    p.addButton("done");
    p.addButton("somedaymaybe");
    
    var didSelect = p.show();
    
    if (didSelect)
    {
    
    if (p.buttonPressed == "todo")
    {
    draft.addTag("todo");
    }else if (p.buttonPressed == "done")
    {
    draft.addTag("done");
    }else if (p.buttonPressed == "somedaymaybe")
    {
    draft.addTag("somedaymaybe");
    }
    
    draft.update();
    }

Options

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