Dynalist formulas

Hi all. I’ve hacked up something that somebody may find useful. It’s a tampermonkey userscript that does two things:

  1. It lets you show a count of the number of instances of any visible tag
    Eg to count instances of a tag called #cat use #count(#cat)

  2. It lets you show a total of a value referenced by any visible tag in the format #someval=x
    Eg use #legs=4 #legs=3 #sum(#legs) to count 7 legs


Raw gist is here (for installing in tampermonkey)
Source code here

Notes/Disclaimer/Bugs:
I’m not a jquery expert, it’s probably buggy. Any suggestions/bug reports welcome.
The code runs a loop once a second. Performance should be OK, but may be slow if there are hundreds of visible tags.
Sum is integer only just now
Content in notes gets counted/summed if parent node is visible
Node being edited doesn’t get counted/summed
Formatting around the formula works (ie you can bold/italic etc the summed value)

8 Likes

that’s what it does

  • tho how does it help make life better?

  • & how is it beneficial?

  • & what positive or good effects does it lead to?

1 Like

This is great!

Now I can make a “toolbar” on top of every document that shows which contexts have the most todos.

Why is this better than the built in tag panel? Well the built in tag panel also counts items that are marked completed. Making it’s count very unreliable.

4 Likes

Hi, this is FABULOUS!!!

Two questions though:

  • HOW DO I IMPLEMENT THIS (in the desktop version)?
    I copied the code from the link that said “source code here” and pasted it in Dynalist under the Dynalist Pro-tab where it says “custom css here”, but it doesn’t do anything…
    I’m not a programmer or high tech-person, so sorry, but I don’t understand. :slight_smile:
    Can someone please explain?

  • Would there be a way to make the value that is counted a TIME DURATION instead of a number?
    For example: #estimatedtime:1’15’’ and #estimatedtime: 0’30
    to then have the sum using #sum(#estimatedtime) to count 1’45’’?

I’m using Dynalist for tasks & planning.
I would like to copy the setup of @Kenneth_Aar to have an overview of the total amount of time of all my tasks for that day/week/month…

So automatic sums of time duration would help me a great deal to get a clear overview.

Thanks in advance for your reply!

1 Like

To make this work in the desktop app open the console (Ctrl+Shift+I) -> console and enter

$('head').append('<script src="https://cdn.rawgit.com/jacrify/67f68a544f09bd83cd18a14231f1ceac/raw/d558adf99b12478eda1d62b8c43d3f6755977bcb/dynalist_formulas.user.js"></script>')

The downsite is that you have to do this everytime you restart Dynalist.

Your second question:
This is definitely doable but the script needs to be extended for that.