I'm not sure but I think it's possible to access the first selected element of the tree which in our case would be the directory to scaffold to. When the directory is not empty the user shall be asked if they really want to use it with the option to select a different directory (current behavior). If the selected file is not a directory just immediately open the select folder dialog.