Drafts Action Directory

Apply Tag and Flag

Posted by SingleItemStore, Last update 4 months ago

Applies a predefined tag and flag to the current draft

Install

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

Comments

Actions available in the Action Directory are uploaded by community members. Use appropriate caution reviewing downloaded actions before use.