Action

Apply Tag and Flag

Posted by SingleItemStore, Last update about 6 years ago

Applies a predefined tag and flag to the current draft

Steps

  • script

    var tags = ["JS", "Writing", "Document", "List"].sort();
    
    /* Configure prompt */
    var p = Prompt.create();
    
    p.title = "Apply Tag";
    p.message = "Select tag for current draft.";
    
    for(var item of tags){
      p.addButton(item);
    }
    
    /* Display Prompt() */
    var didSelect = p.show();
    
    if (p.buttonPressed != "") {
      draft.addTag(p.buttonPressed);
      draft.isFlagged = true;
    
      app.displayInfoMessage( "Applied Tag: " + p.buttonPressed );
    
      draft.update();
    }
    
    if (p.show == "false") {
     alert("cancel");
    }
    

Options

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