Action

Add Favourite Tags

Posted by sylumer, Last update almost 2 years ago - Unlisted

Each line in FavTags defines a new tag to be available.

Steps

  • defineTemplateTag

    name
    FavTags
    template
    First
    Second
    Third
    Fourth
    Fifth
  • script

    let pTags = Prompt.create();
    
    pTags.title = "Select Tags";
    pTags.message = "Select the tags to add to the current draft.";
    
    pTags.addSelect("TagList", "Tags", draft.getTemplateTag("FavTags").split("\n"), [], true);
    pTags.addButton("Add");
    pTags.addButton("Cancel");
    
    
    if (pTags.show())
    {
    	if (pTags.buttonPressed == "Add")
    	{
    		let astrTags = pTags.fieldValues["TagList"];
    		astrTags.map(strTag => {draft.addTag(strTag)});
    		draft.update();
    	}
    }

Options

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