Combining in a single string actions that may apply to a tiddler

I have long wanted to have a filter or syntax that allows me to provide a single string that includes both a list of fields and a filter such as an Extended Listops Filter .

This list may include something like fieldname|listopsfilter which then sets the fieldname and applied the filter. examples may include;

tags|[toggle[todo],[done]], ... ie fieldname and a listop to do there.

But we can easly imagine the need to selectively apply the listop to a tiddler eg;

[display[filter]]|tags|[toggle[todo],[done]], ...

But then of course we want this to generate the listops actions that we can trigger with a button. Somehow we need to choose a button name within or outside this.

Why

Because a mechanism to update tiddlers using common actions is currently restricted only to per field/tags and it would be nice to be able to provide an action string that can operate on any and all fields we desire, to update a tiddler. This would simplify codifying actions.

Further

Add a time keys log of tiddlers so actioned or allow an action history. Thus for example we can see a list of tiddlers that became done today (or any day).

Inspired by Add tags to tiddlers with filter? - #6 by TW_Tones

Your feedback please

Please let me know if you can think of a simple way to do this so we can avoid an unnecessarily complex solution.

You are proposing a short-hand syntax for something related to listops, but I’m having trouble understanding what. Concrete examples of “short-hand” and corresponding “long-hand” would go a long way to help my understanding.

To that end I asked chatgpt to guess at what you might mean and it said maybe you mean this would be short-hand:

[tag[task]] |
tags|[toggle[todo],[done]] ,
categories|[add[finished]]

for this long-hand

<$list filter="[tag[task]]">
  <$action-listops
    $tiddler=<<currentTiddler>>
    $field="tags"
    $subfilter="+[toggle[todo],[done]]"
  />
  <$action-listops
    $tiddler=<<currentTiddler>>
    $field="categories"
    $subfilter="+[add[finished]]"
  />
</$list>

Is that right?

1 Like

Yes this example you gave is a close match, I want to hand the “string” of things (fields) to action filters and have them all done. It would assume currentTiddler but the filters could also use other titles/fields/variables. For now I think it wise to only handle the actions by passing this string or a reference to it eg stored in a field, and provide the trigger separately.

  • To be comprehensive we may need to do something to include adding records to data tiddlers etc…

Stepping back, think of it as allowing you to type in a string that will do as its asked.

I am keen to find a way to have compound strings that identify tiddlers to change (default currentTiddler) then one or more fields and the listops (or other filter string) to apply to that tiddler/field.

The inspiration I am looking for is to co-opt existing patterns, or introduce one which in intuitive. One example may be the existing short transclusion form {{title!!field||}} which can be used or reworked to specify the tiddler/field/values filter. It also seems useful if each of these could return actions for one or mor tiddler/one of more fields for larger actions sets.

  • “title (default currentTiddler) or title filter | field(s) or field name filter | filter to act on each field in each tiddler resulting (eg toggle tags)”

This action string could be found in a string, variable or field/tiddler value

The “filtered transclusion” already handles the title filter

  • {{{ filter ||template|param1}}} and can now accept parameters, so we could write the “template” tiddler to transform the filter and parameters into action listops statements. However in this case we first need to write the template tiddler.