Depending on the attributes of a tiddler, I want to do several things when I finish editing it. I achieve all such actions through a $:/MyDoneActions
tiddler tagged as System
. It is called from the save-tiddler-actions()
macro in $:/core/ui/EditTemplate
like this:
{{||$:/MyDoneActions}}
The $:/MyDoneActions
tiddler contains:
<$list filter="[<currentTiddler>get[text]splitregexp[\s+]count[]compare:integer:lt[50]]">
<$action-listops $field="atts" $subfilter="small" />
</$list>
<$list filter="[<currentTiddler>!p1-date[]]">
<$action-listops $field="related" $subfilter="rep" />
</$list>
The problem is that even for tiddlers with less than 50 words, ‘small’ is not added to the field ‘atts’. At the same time, for tiddlers with non-blank ‘p1-date’, ‘rep’ is added to the ‘related’ field.
How do I get TW to add the appropriate value to the ‘att’ field? Is there something wrong with the way I am computing the wordcount? May be some syntax error?