this is a templater script i use to quickly add tags to the front matter of the current note in obsidian. it lets you choose from your already existing tags, and you can also make a new tag. here’s what it looks like:

a video showing a popup modal to quickly add tags to a note in obsidian

when you run the script, a modal pops up with your pre-existing tags. start typing to search for an existing tag, then hit enter to select the highlighted tag. to use a new tag, hit enter once, type your new tag, then hit enter again. repeat this process for as many tags as you want to add to your note. when finished, hit enter twice.

inside your templates folder, create a new markdown file. mine is called tag adder.md. add the following line to it, removing the \ between < and %: <\% tp.user.add_tags(tp) %>. now create a new javascript file in your templater scripts folder called add_tags.js. add the following to it:

/**
 * add tags to a file. suggests already existing tags and allows user to type new ones.
 * type to look for and add an existing tag. hit enter to add a new tag.
 * hit enter twice to finish.
 */
module.exports = async function (tp) {
    async function promptTags() {
        const existingTags = Object.keys(tp.app.metadataCache.getTags()).map(t => t.replace(/^#/, ""));
        let newTags = [];
        let keepGoing = true;
 
        while (keepGoing) {
            // Suggest existing tags or allow user to pick none
            let tag = await tp.system.suggester(
                (t) => t,
                ["(Type a new tag)", ...existingTags],
                false,
                "Select or type a tag (leave empty to finish):"
            );
 
            if (!tag) {
                // user hit escape or closed modal
                keepGoing = false;
            } else if (tag === "(Type a new tag)") {
                // prompt for free text input (Enter = confirm, empty = stop)
                let customTag = await tp.system.prompt("Enter new tag (blank to finish):");
                if (!customTag || !customTag.trim()) {
                    keepGoing = false;
                } else {
                    customTag = customTag.trim();
                    newTags.push(customTag);
                    if (!existingTags.includes(customTag)) existingTags.push(customTag);
                }
            } else {
                newTags.push(tag);
            }
        }
 
        return newTags;
    }
 
    const selectedValues = await promptTags();
 
    if (selectedValues.length) {
        const file = tp.file.find_tfile(tp.file.path(true));
        await tp.app.fileManager.processFrontMatter(file, (frontmatter) => {
            const existing = Array.isArray(frontmatter["tags"]) ? frontmatter["tags"] : [];
            frontmatter["tags"] = Array.from(new Set([...existing, ...selectedValues]));
        });
        new Notice(`Added tags: ${selectedValues.join(", ")}`);
    } else {
        new Notice("No tags added.");
    }
 
    return "";
};

to run this script from the command prompt or a hotkey, go to the templater plugin settings. under “template hotkeys”, add the path to the markdown file tag adder.md. it should now appear in the command prompt. you can bind it to a hotkey under “hotkeys” in obsidian’s settings.