Hi Mat,

It would certainly be possible to do so but, I agree with what Jed said, if 
the macro gets called multiple times it will create multiple instances of 
the timer event. This is probably not what what you want (and certainly not 
what I want).

The relevant bit of code (from above) that creates the timer event is this 
...

setInterval(function() {
      /* Put your code here, it gets triggered every 300000 milliseconds (5 
minutes) */
   }, 300000); /* 300000 for 5 minutes */

Jed had also suggested (in an earlier thread) that it would probably be 
better to put it into a startup module. I'll be figuring out how to create 
a startup module and moving the logic there. If I have time, I'll figure 
out how to add to the settings so that people can define the trigger period 
and class name.

On Sunday, September 16, 2018 at 4:47:15 PM UTC-4, Mat wrote:
>
> @Lost Admin
>
> This is of great interest for a thing I'm working on for TWederation, 
> hopefully soon to be published. As you may know Jed has built a special 
> server (Bob) and also a plugin (TWederBob) that enables a wiki to fetch 
> tiddlers from the remote server. I would like for this fetching (an action 
> widget) to trigger periodically.
>
> Would it be possible to use your creation for that? I.e to trigger an 
> action widget at set time intervals?
>
> <:-)
>

On Monday, September 17, 2018 at 8:37:10 AM UTC-4, Jed Carty wrote:
>
> The biggest problem I see with a macro based solution like this is that it 
> may get called multiple times (and start multiple timers that all do the 
> same thing) because it runs unconditionally when rendered and nothing 
> removes the setInterval.
>>
>>
> I think that a much better solution would be to make a startup module that 
> starts a background daemon that will run a set of action widgets at 
> configurable intervals. It shouldn't be too difficult to make, if I have 
> the time I will try and put something together.
>

I agree. That's my next step. 

-- 
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 post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tiddlywiki/977a8df1-d1ac-4baf-9db7-1a4fd3507cad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to