Templater icon indicating copy to clipboard operation
Templater copied to clipboard

A Random Note/File command

Open alierecast opened this issue 4 years ago • 2 comments

I'd like to be able to add randomness to a template, much like <% tp.web.random_picture() %> does, except from my own vault. (My specific use case is: I'd like to have an easy way to insert a random image from one of the subfolders from my attachment folder. A generalized randomness function without having to understand the javascript would probably be more useful than solving my very narrow case, though.)

If the javascript to do this is super simple and I just haven't gotten it, forgive me, I stared at someone's example for a similar thing for two days before I came here to make the suggestion.

alierecast avatar Jun 06 '21 19:06 alierecast

How can I use https://github.com/javalent/dice-roller rolled results inside templater?

xgdgsc avatar Sep 14 '23 10:09 xgdgsc

You can write a script to use the random function: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random

AB1908 avatar Sep 14 '23 10:09 AB1908