Here would be a rough-draft thought-experiment, which the experts can refine. (Please see update below.)
As you know, any container can do a two-level sort – eg first by $Name, and then by $DueDate (0r whatever). You do so in this inspector:
So how about if your first sort was
$ChildCount, which serves to distinguish containers from mere notes? I don’t think there is an attribute called $IsContainer, but $ChildCount (I think) gives you the same info. Any container will by definition have a $ChildCount of >0, while any note will by definition have a count of 0.
Then, your second-pass sort could be by $Name.
I think that two-level sorting would give you first all your containers (or all your notes, depending on which way you order the sort), and then would sort each of those groups by name.
Update I realize the flaw in my scheme! If you have containers with different numbers of child items, then you’d get the container part of the grouping sorted that way–that is, first the container with 1 child, then the one with 3 children, then the one with 10–rather than by $Name.
So how about this:
- Create a new user attribute, $IsContainer
- Create a rule or edict (at whatever is the appropriate point in the structure), saying that if $ChildCount>0, then $IsContainer=true, else $IsContainer=false.
- Then set up the sort scheme so the first pass is on $IsContainer, and the second pass is on $Name.
What about that?