How do I hide all folder with a button

I want to hide all the folders in a directory so I only have to deal with the loose files. I have two buttons one says hide folder and the other hide files. I have no idea where they came from but they don't work.

I suspect I made the buttons a long time ago when I was new to opus, but not sure. Here are some images to show what I am talking about.


You can even combine the buttons into one:

Set HIDEFILTERFOLDERS="*"
@toggle:invert
1 Like

Thanks I will try that. Any idea if those buttons I had were just some old mistakes of mine or if they came with opus?

They are "User-defined commands", so probably yours. :wink:
On the next tab, "User Commands", they should be listed and you can view/edit them.

Did a search for hide_folder with everything and found a hide_folders.ouc. I must have gotton it from the forum here. Not sure why it doesn't work though. it seems to effectively use the same command that MartO give me.

The code in it is:

<?xml version="1.0" encoding="UTF-8"?>

<usercommand backcol="none" hide_from_menu="no" textcol="none">

<label>Hide_Folders</label>

<user_label>Hide Folders</user_label>

<icon1>#deletecollection</icon1>

<function type="normal">

<instruction>Set HIDEFILTERFOLDERS regex:&quot;*&quot;</instruction>

</function>

</usercommand>

Oh thanks thats much more readable than the xml I posted. your solution works great. so I will just delete these other commands

1 Like

There is also the built in filter bar which has several options including "Hide all folders"

You can get the filter bar to show up by adding a button that just has the commands below which will have it toggle on/off

@if:Set QUICKFILTER
Set QUICKFILTERCLEAR
Set FOCUS=source
@if:else
Set QUICKFILTER

Edit: I forgot I had the above code set as a user command called ToggleFilterBar lol

Here is a three button button that offers:

  1. View only files
  2. View only folders
  3. View only files and select them
  4. View only folders and select them
  5. View all files and folders

View Only Files, Only Folders or All.dcf (1.9 KB)

Here is the code:

			<button 3dborders="no" backcol="none" display="both" icon_size="large" label_pos="right" textcol="none">
				<label>Only Files, &lt;kbd&gt;Shift&lt;/kbd&gt;: Select All</label>
				<tip>Only Files, &lt;kbd&gt;Shift&lt;/kbd&gt;: Select All</tip>
				<icon1>#file</icon1>
				<function type="normal">
					<instruction>@keydown:none</instruction>
					<instruction>Set HIDEFILTERFOLDERS=*</instruction>
					<instruction>@keydown:shift</instruction>
					<instruction>Set HIDEFILTERFOLDERS=*</instruction>
					<instruction>Select ALL</instruction>
					<instruction>Set CLEARFILTERS</instruction>
					<instruction>Set SHOWEVERYTHING=Off</instruction>
				</function>
			</button>
			<button 3dborders="no" backcol="none" display="label" icon_size="large" label_pos="right" textcol="none">
				<label>Only Folders, &lt;kbd&gt;Shift&lt;/kbd&gt;: Select All</label>
				<tip>Only Folders, &lt;kbd&gt;Shift&lt;/kbd&gt;: Select All</tip>
				<icon1>#folder</icon1>
				<function type="normal">
					<instruction>@keydown:none</instruction>
					<instruction>Set HIDEFILTERFILENAME=*.*</instruction>
					<instruction>@keydown:shift</instruction>
					<instruction>Set HIDEFILTERFILENAME=*.*</instruction>
					<instruction>Select ALL</instruction>
					<instruction>Set CLEARFILTERS</instruction>
					<instruction>Set SHOWEVERYTHING=Off</instruction>
				</function>
			</button>
			<button 3dborders="no" backcol="none" display="label" icon_size="large" label_pos="right" textcol="none">
				<label>All Files and Folders</label>
				<icon1>#FolderFiles</icon1>
				<function type="normal">
					<instruction>Set CLEARFILTERS</instruction>
					<instruction>Set SHOWEVERYTHING=Off</instruction>
					<instruction>Select NONE</instruction>
				</function>
			</button>
		</button>