Adding a bit of code so Obsidian templates auto-archive, auto-name, and number your notes.

Code link: task - template

00:00 Problems with using templates 00:39 Template mapping for auto-archiving 01:22 Auto-filling the title + number 01:51 Outro

content

Why not just use the QuickAdd plugin?

For the requirement: auto-archive + fill in the title + auto-increment a number + match projects with the same prefix

Using a Templater template directly is better. Reasons:

  • My scenario (input ID → look up project name → fill in metadata) isn’t complex logic; Templater’s tp.system.prompt() + JS is more than enough
  • The logic and the template live in one file, which is easier to maintain
  • QuickAdd Macro requires configuring two layers (Macro + Template), which is more annoying to debug

When QuickAdd is a better fit:

  • you need a dropdown selection (CHOICE)
  • you need to chain multiple steps (create file → open → append content)
  • it’s shared across a team and you don’t want people touching code