New Edit->Insert features

I am more and more impressed with how useful the new feature of Edit->Insert->Expression can be when creating content in a Note’s $Text attribute. I find myself including expressions to count occurrences in Notes, insert sums and averages, etc. Very effective.
But–I am baffled by the Edit->Insert->Checkboxes feature. In theory, this could help signal to-do’s within the $Text content for later follow-up. However, I can’t seem to come up with action code that would count checked or unchecked Checkboxes in Note. And why is the default Checkbox “checked?”

  1. The checkbox will be initially unchecked in the next release. I was concerned that an unchecked checkbox might be too similar to the symbol for “glyph for which no rendering is available” box, but the extra click is annoying.

  2. $TextCheckboxes is a list of checkbox values, so $TextCheckboxes.count_if(x,x==true) is the count of checked checkboxes. This can also be written

$TextCheckboxes.count_if(x,x)

Relevant:

  • In-text check-boxes. That tells us there is an attribute holding checkbox states, linking to the article on …
  • $TextCheckboxes. This tells us the attribute is a multi-value list, specifically List-type data, holding the true (ticked) or false state of each tick-box. Thus…
  • As we only want to count list values of a certain type (here, true), we can look at available Data manipulation operators (or look for list-based operators in the Full Operator List) and from that we see…
  • there is a list.count_if(loopVar, condition), as used in the example above.

Excellent, and I now get it … thanks, @eastgate and @mwra !

2 Likes