Auto-destructing Callouts via Meta Bind button?

What I’m trying to do

Hi folks! I’m looking to have some method of putting a button inside of a callout which (once clicked) would delete the entire enclosing callout, including the button itself. Main use case for this is to give myself instructions for filling out different kinds of notes created through Templater. Kind of a jog-my-memory but burn-after-reading vibe, not unlike a message from the Chief on an old episode of Inspector Gadget.

Things I have tried

I installed the Meta Bind community plugin for its button feature and was able to create a semi-functional button with this block:

> [!note] Title
> This is the content of the callout.
>
> ```meta-bind-button
> style: primary
> label: Clear Callout
> action:
>   type: "regexpReplaceInNote"
>   regexp: "^> \\[!note\\] Title\\n(> .*(\\n|$))*"
>   regexpFlags: "gm"
>   replacement: ""
> ```

This gave me the look I was going for:

But unfortunately clicking the button only chops off the top two lines, leaving behind a blockquote containing the button block:

I’d appreciate any advice on how to achieve a full callout self-destruct, whether with Meta Bind or anything else!

Use this as your regexp: "^> \\[!note\\].*?\\n>.*?\\n(?:>.*?\\n)*> ```.*?\\n(?:>.*?\\n)*> ```\\n?"

1 Like

Worked like a charm; thanks so much!

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.