I am trying to create a command that would collapse a folder, and all its sub-folders. I tried;
Go Root=collapse
But, that collapse everything under the current root (ie. including other neighbouring folders at the same level) I just want to collapse all sub-folders underneath my current highlighted folder.
I'm not sure if this helps, but if you press the minus key on the numeric keypad, it collapses the current folder in the tree (provided the tree has focus). Also, plus expands the current branch.
Incidentally, asterisk (*) on the keypad also expands the current branch and all subfolders of the current branch.
Unfortunately, none of these can be bound to commands.
Another Folder Tree collapsing issue I've found is actually a difference to expected behaviour from a generic TreeView control: when you double click over the LINE connecting an expanded folder and its next sibling, then the first folder collapses. This implies that you have to enable Lines first (disabled by default in DO).
You can find this behaviour in almost any TreeView common control (in fact, this is the golden rule of any common control: consistence!). It's specially useful in RegEdit, when you need to collapse a folder that contains a huge amount of subfolders. In that cases you usually don't have at sight the folder to close, so it's much easier to double click on the long vertical lines.