Tag drafts by hashtag

Posted by derekvan, Last update over 5 years ago

This script looks for drafts in the inbox that have hashtags in their content, then adds a drafts tag based on the hashtag. Thanks to kjaymiller for the original script I built on.


  • script

    // This script builds on kjaymiller script to find hashtags inside drafts by looking not just at current draft, but all drafts in inbox. Original script:
    // Get all the tagged drafts in the inbox
    var taggedDrafts = Draft.query("", "inbox");
    // find tags in content
    var re = /#[\w\d]+/g;
    // Tag drafts
    for (var i=0; i<taggedDrafts.length; i++) {
    	var tags = taggedDrafts[i].content.match(re);
    	for (tag in tags) {


  • 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.