Hi all. Iāve hacked up something that somebody may find useful. Itās a tampermonkey userscript that does two things:
-
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)
-
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
http://www.giphy.com/gifs/3ohs4dSdAigPIdCMP6
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
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: :slight_smile:](https://talk.dynalist.io/images/emoji/apple/slight_smile.png?v=12)
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.