[tw5] triggering send-message from a permalink URL

I am using Ben Weber’s DND campaign tools twiki (dnd — Manage Dungeons & Dragons campaigns with TiddlyWiki.).
It has a feature to export a copy of the twiki that only include non-system tiddlers w/ the ‘Public’ tag. Core to that feature is calling send-message ‘tm-download-file’.

I am looking for a way to automate this via a cron and wget.

I’ve been looking but am at a loss of a way to trigger an action widget via direct URl call.

Any suggestions would be most appreciated.

Try this:

  1. In your TiddlyWiki, create a new tiddler named “download”, containing:
\import $:/plugins/benwebber/dnd/ui/Buttons/export-player-edition
<$list filter="[{$:/info/url/search}match[?download]]">
<<actions>>
</$list>
  1. tag this tiddler with $:/tags/StartupAction/PostRender

Then, to trigger the action from a URI, add ?download to the end of the URI. The result should be the same as using the “Export Player Edition” button from the sidebar page controls.

Note that I tested this by loading into a browser. It might not work when using wget, as “$:/tags/StartupAction/PostRender” is only triggered when running in a browser. I also tried “$:/tags/StartupAction”, which should work even without a browser (i.e., using wget), but it didn’t seem to work for my tests, and I’m not sure why.

Let me know how it goes…

-e

1 Like

I see what you mean, It works in browser, but i can’t get it to trigger from commandline.
I was unaware of the StartupAction tags, and so now i need to go read up more.