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.

1 Like

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
```

Second way is to use Regex Find/Replace command (Find and replace in selection plugin) with

^- \[x\].*(?:\r?\n|\r)+

expression (can be used for one line or all text). Then you can use cMenu plugin and place those commands in there.

(?:\r?\n|\r)+

This needed to delete line breaks.

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