This button will do this.
@nodeselect
Select PATTERN=* TYPE=dirs DESELECTNOMATCH
Go FROMSEL NEWTAB=nofocus
Maybe adding a hotkey is already enough automation? If not, a script would be needed. This one should work:
Script For Running Various Commands When Entering Specific Paths