DON'T RUN THE FOLLOWING CODE! Unless you're prepared to reboot your TW. It 
gives you a button to start a timer that every 10 seconds posts the seconds 
to the subtitle. You might want this feature if you were tracking how much 
timer you were spending on a project. What's critically missing is a method 
to turn off the timer! It will keep going even if you change the name of 
the internal macros, so I guess they must be compiled at the start. I'm 
thinking a reveal widget that depends on the existence of another tiddler 
could be used to turn off the timer.

If you hit the button a second time, it will start a second thread (not 
really a thread), and the subtitle will switch back and forth between the 
two different cumulative times.


\define timer()
<$action-setfield
   $tiddler='$:/SiteSubtitle'
   text=<<cum>>
/>
<$set filter="[<cum>add[10]]" select=0 name=cum>
<$action-delay delay='10' actions=<<timer>>>
</action>
</$set>
\end
\define timerstart()
<$action-delay delay='1'>
</$action>
    
\end

<$vars cum=0>
<$button>
Start timer <<cum>>
<<timer>>
</$button>
</$vars>



On Thursday, May 7, 2020 at 4:42:53 AM UTC-7, Jed Carty wrote:
>
> I needed a break from my other work, so I made an action widget that can 
> add a delay to the execution of other action widgets.
>
> Enjoy.
>
> https://ooktech-tw.gitlab.io/plugins/delayactions/
>

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/904a65b1-9d92-45eb-88f2-b04f93cdc59a%40googlegroups.com.

Reply via email to