open tagged draft

Posted by FlohGro, Last update about 1 month ago

created by @FlohGro / more on my Blog

Easily open Drafts from a selected tag.

The Action displays a prompt with all your tags.
If you select a tag it will filter the drafts in your library and you can select the draft to open (if only one draft with that tag is found, it will be opened immediately).

If you find this useful and want to support me you can donate or buy me a coffee

Buy Me A Coffee


  • script

    // open tagged draft 1.0
    // created by
    let tags = Tag.query("").sort()
    // prompt to select tag scope / nest
    let p = new Prompt();
    p.title = "select tag"; => { p.addButton(t) });
    if ( {
        let selectedTag = p.buttonPressed;
        let foundDrafts = Draft.query("", "all", [selectedTag], [], "modified", true, true);
        let selectedDraft = selectDraft(foundDrafts)
        if (selectedDraft) {
        } else {
            app.displayInfoMessage("no draft selected")
    } else {
        app.displayInfoMessage("no tag selected")
    function selectDraft(draftsList) {
        if (draftsList.length == 1) {
            app.displayInfoMessage("open the only draft with the selected tag")
            return draftsList[0]
        let p = new Prompt()
        p.title = "select draft" => { p.addButton((d.isFlagged ? "🚩 " : "") + d.displayTitle, d) })
        if ( {
            return p.buttonPressed
        } else {
            return undefined


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