Limit on number of found items thrrough a filter

Is there a limit on the number of items found through a filter if each of those items has a subsequent action?

For example, my rearrangedate script, as provided by @Scott_Sauyet ,

<$button>Update date fields
<$list filter=[tag[All Items]has:field[date_start]]>  <!-- Change me -->
  <$action-setfield $field="date_start" $value={{{ [{!!date_start}split[/]reverse[]join[]] }}} />
  <$action-setfield $field="date_end" $value={{{ [{!!date_end}split[/]reverse[]join[]] }}} />
</$list>
</$button>

appears to run but I see a very quick flash of something to the right of my window but so fast I can’t see what it says. Nothing appears to get changed though, so it would appear the script is not doing anything.

However, if I change the filter to

<$button>Update date fields
<$list filter=[object_type[Event]has:field[date_start]]>  <!-- Change me -->
  <$action-setfield $field="date_start" $value={{{ [{!!date_start}split[/]reverse[]join[]] }}} />
  <$action-setfield $field="date_end" $value={{{ [{!!date_end}split[/]reverse[]join[]] }}} />
</$list>
</$button>

then everything runs as expected.

If I trial

[tag[All Items]has:field[date_start]]

in the filter test facility, all items (457) appear to be returned.

bobj

Your first filter syntax contains a space (“All Items”). You need to put quotes around the filter syntax, like this:

<$list filter="[tag[All Items]has:field[date_start]]">  <!-- Change me -->

Note that the second filter syntax doesn’t have any spaces. That’s why it works even without the enclosing quotes.

enjoy,
-e

@EricShulman thanks for the answer.

However, I don’t wan to be unnecessarily picky, but it should work the same way in the filter test facility .Otherwise, it gets very confusing. Filter notation is confusing enough as it is.

It has been some time since I got into TW scripting due to recovering from flooding rains earlier this year. I have gone back to the GROK TW (Grok TiddlyWiki — Build a deep, lasting understanding of TiddlyWiki) section on Filters and Transclusions to remind me of what bracket where and when.

bobj

The filter syntax that you enter into the $:/AdvancedSearch Filter input field is referenced internally using either:

<$list filter={{!!fieldname}} ...
or
<$list filter=<<variablename>> ...

In both of the above uses, the value of the filter=... parameter is explicitly delimited by either the {{...}} or <<...>> syntax, so there is no ambiguity as to where the filter syntax starts and ends.

However, when the filter syntax is entered directly into the $list widget as a literal plain text parameter value (as you have done) it needs to have quotes surrounding it as delimiters.

<$list filter="some filter syntax here" ...

This is because ALL widget parameters (not just filters in $list widgets) are implicitly delimited by spaces, so anytime a literal widget parameter value contains spaces, it MUST be enclosed within some kind of quote delimiters.

This is 100% consistent with way that field references use {{...}} delimiters and variable references use <<...>> delimiters, and is fundamental to TiddlyWiki widget usage.

Arguably this is fundamental to most programing or macro languages, so should be a rule. Personally I rarely don’t use the double quotes to delimit a parameter unless it contains double quotes, and in tiddlywiki we make use of other delimiters as @EricShulman states, you could say, except for double quotes, why delimit when it already is.

Post script

  • I dont want my code to fail if I insert a space, so I use double quotes.