MacOS – Closing folders in list view

applescriptfindermacos

I'm looking for a way to close opened folders in the list view. I was thinking that applescript might have a way but I don't know what to look for.

enter image description here

Like here, I want to get the current selected folder and then go through each subfolder and close them. Is that possible or can anyone point me to the action that closes a folder?

Best Answer

Opt ⌥ -Click the reveal arrow next to foo.

Alternatively, Opt ⌥ will do the same thing.
Opt ⌥ will re-open them all.

It appears Mojave closes them all by default now [though with no real consistency I can find], but previously opt/action was the way.