Triggering ActionWidget (e.g., action-setfield) programmatically from a macro

30 views
Skip to first unread message

Sid T.

unread,
Dec 8, 2021, 9:33:14 AM12/8/21
to TiddlyWiki
Hi, I'm trying to understand how to programmatically add a field or tag to a tiddler.

I'm trying to auto add tag or field to my tiddlers. My thought was to use a macro, such that whenever I add it to a tiddler's text, the macro adds a tag or field value to the current tiddler.

Examples on TW5 show a button that needs to be clicked, but I'm looking to do something like the following:

\define todo()
<span><strong>To Do</strong></span>
<$action-setfield field="mytodo" value="todo"/>

\end
---

<<todo>> // adds a field "mytodo" with value "todo"

Thanks!
Sid

Riz

unread,
Dec 8, 2021, 11:16:34 AM12/8/21
to TiddlyWiki
You can rewire the save tiddler button to check for the presence of words in tiddler text and if yes, execute actions. I assume the search operator will come handy. 
Reply all
Reply to author
Forward
0 new messages