Expand/Collapse Folder button

Simple button that will toggle between expand and collapse currently selected folder(s).
Will be disabled if current selection is not a folder or folder expansion is off.

see How to use buttons and scripts from this forum - Buttons/Scripts - Directory Opus Resource Centre (dopus.com)

Expand_Collapse folder.dcf (391 Bytes)

5 Likes

Related: The new default toolbars have Expand/Collapse All Folders, which is similar but does all folders instead of the selected folders.

3 Likes

@Leo Could the function also be available in group mode in the official release? Now I can only use one of both, it's hard to make a choice :joy:

1 Like

With this button, only the folder of the current path can be expanded/collapsed, the next level folder can't be expanded/collapsed, is it possible to specify the depth of the path when working?

You can't specify a depth (at least currently), but you could use this:

Go * EXPANDBRANCH=wild

That will expand all currently visible folders. It won't recursively expand them in a single click, but it'll expand another level each time you run it. So you could put it on a button or hotkey and click it a few times to open multiple levels.

(Could also have a script that runs it until there's nothing left to expand. Just make sure it doesn't loop forever if there's an error preventing expansion, e.g. due to folder permissions.)

3 Likes

Thinking about this some more, if you want to expand all levels, the old Flat View (Grouped) mode will give you that. (At least unless you then want to collapse some levels selectively afterwards.)

Hello.
Is there any script event for folder expand (clicking on arrow) in order to override and expand all selected directories?

Not currently, at least.

For me, the whole feature does not seem to work. It is turned on in the settings as 'always show' but it does not show in any view. The two options under folders mentioned here in the thread are always greyed out.

Even if you go to a basic folder like C:\?

Could you show us a screenshot?

This is in the settings:


This is the lister with basic folder C:

This shows in the folder-menu while c is selected as above:
image

You can't use grouping and expanded folders at the same time (as the display wouldn't really make sense).

I thought it would just open the content of the folder not grouped within the grouped general view. But that was it, it worked when grouping was off. Thanks for the quick reply :slight_smile:

1 Like

That would be the only practical way to do it, and we may add this in the future.

4 Likes

Expandable folders is a great new feature. Groups is a great old feature which has been enhanced by the new evaluator groups. I use both and do sometimes find myself going to expand a folder when in grouped mode only to find it is not possible. So now the decision is to use one or the other.

For now, I have set this button plus hotkey:

@if:Set GROUPBY=off
Set EXPANDABLEFOLDERS=Off
Set GROUPBY=modified
Set SORTBY=name
Set SORTREVERSE=Off
@if:else
Set GROUPBY=off
Set EXPANDABLEFOLDERS=On

You shouldn't need the Set EXPANDABLEFOLDERS=... lines. If it's on in Preferences, it'll be available automatically when grouping isn't in use.

Support ++ a script that runs it until no folder is unexpanded

Support++ using grouping and expanded folders at the same time such that a selected folder is not grouped within the grouped general view

I tried that and could not get it to work that way

+1 for expand in group mode.