Toggle between view folders and files and view just files

I'm using Folder Formats to hide folders and just show files, but I am finding it perhaps more complicated than what I want to do. I would like to create a button that will toggle showing and hiding folders in a single pane. Is there a simple way to do this? Thanks!

The Filter Bar has buttons that will toggle showing and hiding files/folders.

https://docs.dopus.com/doku.php?id=:preferences:preferences_categories:filtering_and_sorting:filter_bar

Set HIDEFILTERFOLDERS=*

???

To clarify a little, that will automatically work as a toggle.

See How to use buttons and scripts from this forum for how to use the command.

Perfect, thanks fkast and Leo