New Plugin: Auto-properties

This plugin allows you to create automatically-updating note properties based on user-defined rules. This pairs nicely with bases and templates.

:backhand_index_pointing_right: Demo Video :backhand_index_pointing_left:

See the Github Repo

Use Cases

My use case was based on pulling the first open task into a property… but you can do much more.

  • All open tasks

  • First open task

  • First task with status

  • First line with tag (or any given text)

  • All lines with whatever text

  • First embedded image

  • File modification time

Design Considerations

Do one thing

This plugin is intentionally small. It does one thing. No unncessary overhead. Maximum modularity.

You specify the keys & rules

You have control over the keys (property names) you do and don’t want to have rules for. You control what the rules do.

Note bodies are never changed

For safety, this plugin only updates note properties. It will never modify the body of the note. This prevents accidental data loss.

Few “smart” touches

The plugin tries to do as little “magic under the hood” stuff as possible - but does do a couple of things to work better with how Obsidian works.

  • targeting embeds (via search string ![[) will convert to a clickable link

  • targeting blocks that have a block ID will convert to a clickable link to that block

  • i.e. it will make links for blocks ending with a space, carrot, and some text ^likethis

Installation

This is in queue to be added to the Obsidian Community plugins page. It will hopefully be added there soon!

In the meantime, you can install via BRAT. I used to think this was an involved process, but it’s actually quite easy.

  1. Install BRAT & enable it

  2. In BRAT settings, click “Add Plugin”

  3. Copy & paste this repo’s URL into BRATs settings

  4. Done.

3 Likes

My man that’s exactly what I use it for.

Personally I’m running three main Auto-Properties:

  1. key: “next”
    rule: “Pull all lines” “starting with” “- [/] “
    modifiers: ignore whitespace, don’t include search string, auto-add property
  2. key: “tldr”
    rule: “Pull first line” “starting with” “> [!tldr]”
    modifiers: ignore whitespace, don’t include search string, auto-add property
  3. key: “image”
    rule: “Pull first line” “starting with” “![[”
    modifiers: auto-add property

I personally have mine auto-update whenever I change active files.

This powers a “Projects” base where I have a TLDR for scope, and pulls all my “IN_PROGRESS” tasks to the “next” property, and an “image” property I use for card-based views. Now all 3 of those things just work with how I was already managing my projects.

It rocks. It actually made me finally understand the concept of “next actions”. David Allen would be, well not proud, but I guess pleased that I finally saw the light.

1 Like

Is it possible to cross link properties?

Say I have a template for a person, having properties : parents, children.

I would like to link the parents and children. If I create a note for “Father”, and link children property to, say “Son” and “Daughter” notes, can I make both “Son” and “Daughter” notes’ parents property to pull “Father” as link, rather than in backlinks?

I would expect this update to happen in all notes at point of edit in the source note.

Unfortunately, no. While I can sympathize with this as a use case, it’s clearly something that could be super useful. I don’t think I can take on this use case, though. Implementing this would be a huge expansion in the code base. I fear it would 10x the code - handling the UI for setting up the cross-linking, doing a scan of other files in the vault to handle updating the property value, and handling potential circular update logic… those are just the immediate things I’d have to handle that I can think of.

I’m sorry this won’t help find what you’re looking for. You might keep looking around though, I feel like I’ve seen a plugin that is meant to help with these sorts of relationships before.