The difference here is that you’re introducing the note title ($Name) as part of the count. In Tinderbox, $Name and $Text are discrete attributes but $WordCount only counts words in $Text. As $Text has a word count, there hasn’t, up to this point needed to have word counting action.
To get the number of words in $Name (or any string):
$MyNumber=$Name.split(" ").count;
My earlier examples won’t work with this as you’d need to iterate each child/descendant to test the size of $Name. But use an edict (not a rule - it doesn’t need to run all the time) for the notes of interest. Add a user attributes of Number type, $NameWordCount and $TotalWordCount. The edict:
$NameWordCount = $Name.split(" ").count;
$TotalWordCount = $NameWordCount + $WordCount
Update, as needed. Then adapt my earlier codes. thus, the total wordcount of just (immediate) children, stored in the note’s $MyNumber:
$MyNumber = sum(children, $TotalWordCount);
Same, but including the current note:
$MyNumber = $TotalWordCount + (sum(children, $TotalWordCount));
Or, total word count of just all descendants, stored in the note’s $MyNumber:
$MyNumber = sum(descendants, $TotalWordCount);
Same, but including the current note:
$MyNumber = $TotalWordCount + (sum(descendants, $TotalWordCount));
If you feel the app needs an attribute representing the word count of both $Text and $name, then send a feature request to support: info@eastgate.com
Though I’m unclear as to why you need this count, one other approach is simply to use the note $Name as the first paragraph of the note’s $Text.