Looking for a script to automatically delete completed todos

I have a note when I have all my ToDos listed in the format:

  • [ ] #todo Description of Action

At the moment, when I mark off the Todo it stays, but is struck through

What I am looking for is a script that operates within this note and preferably:

Can be triggered to remove the completed Todos, using a hotkey.

Would be happy with:

Automatic deletion of the Todo when it is marked complete.

For those who may suggest plugins, this part of my workflow has a specific purpose, I use other todo plugins in the typical workflow fashion (Personal shoutout to Rollover Daily Todos a core part of my workflow)

I use the plugin Archiver for this purpose. It does what you want I think.

I’ll have a look at that, thanks

Do you really want to delete them, or just have them in a separate list?

I use Obsidian Tasks plugin, and have a summary tasks note that does this sort of “hiding”…Combined with header folding it is very effective and you don’t lose sight of completed items.

Something like this, although my use case is a bit more complex.

### Open Tasks
```tasks
not done
```
### Completed Tasks
```tasks
done
sort by done reverse
```