Alternative folder selector

This tool may be useful for those who, like me, have particular sections on their drive(s) where they regularly need to be, anywhere in any of the folders underneath. And where it is also desirable to be able to somewhat fine-tune the presentation of the folders in that particular location.

A few examples may perhaps best explain the idea. In the following button commands (which can be used once the script is installed), the name “AltTreeSelect” is the name of the script, and the parameters after it will affect the presentation.

AltTreeSelect STARTFOL="C:\me\latestdownloads" MAXLEV=9 QUIT

This would indicate to show the entire tree from this particular location (9 levels deep means pretty much “show everything” (you could of course set it even higher). You will use this when you know you are not in danger there of a heavy-duty task (hundreds of folders) - and this is important, because the dialog that shows the tree structure does not have any folder expansion capacities, it will simply unfold the entire tree under this folder. This is by design: the purpose is not “folder browsing” but rather getting a view on a certain part of your folders, and then one click to get to this folder.

the QUIT instruction will indeed close the window when a foldername was clicked - and you will the folder open in the lister where you clicked the button to start up the dialog. You can also, at all times, click a “pin” button in the dialog if want to do multiple clickes (e.g. in search for the right folder in case of doubt).

Another example:

AltTreeSelect STARTFOL="C:\me\Podcasts" MAXLEV=2 MAXSIB="10,5" QUIT

This would be a typical case of an extensive folder structure, where you limit the number of levels to exactly 2 (beneath the chosen folder), and at the same time you limit the number of sibling folders underneath the start-level: at the first lower level, only 10 folders will be shown (there will be an indication showing how many folders are not shown), and at the second level you limit it even to 5. You do not need to indicate numbers for every folder: the last one will be repeated, so:

AltTreeSelect STARTFOL="C:\me\Podcasts" MAXLEV=4 MAXSIB="10,5"

will show 4 levels deep, and the limit of 5 siblings will be repeated for levels 3 and 4.

And of course, you can eliminate STARTFOL:

AltTreeSelect MAXLEV=2

in which case the button command will be applied to the current folder.

(New in v.1.2) You can also use the dialog to move files to a destination instead. Example:

AltTreeSelect MAXLEV=2 MOVETO

In this case, I did not even specify a STARTFOL, which means: the dialog shows the current folder. Even that is useful, as you may often wish to move files to subfolders of your current directory. To move files to other locations, you need to use a button with a STARTFOL argument - and the dialog will still pick up file(s) you selected in an entirely different location - which makes its usage pretty versatile.

Other potential useful argument exist. Here is a complete overview of button arguments you can use:

argument explanation
STARTFOL Folder where to start (if not defined, current folder is used)
NEWTAB Open the folder in a new tab (if there’s not yet one open on this path)
SHOWHID Include hidden folders
SHOWSYS Include system folders
MAXLEV=3 Maximum depth of folder structure to show, e.g. 3 sublevels
MAXSIB=10 Max. sibling folders to show per level (only beneath top-level), e.g. 10 siblings
MOVETO A click on a folder now moves selected files to this folder. This can still be disabled in the dialog, and it can be enabled when files are being selected after the dialog opened.

There are a number of default parameters in the script which you can tune as well. When they are the same function as the button arguments (a.k.a. command line arguments), the latter will override the defaults. Some values that can be changed with buttons in the dialog, will be kept in memory (so they are remembered when you close the dialog) - those too will be overridden by any button arguments. There is one exception: when you “pin” the dialog with the pin button, it will not be overridden by the QUIT command argument. When you pin your dialog, it’s arguably for a reason which shouldn’t be ignored.

Furthermore, the dialog uses two display methods for the (partial) folder tree:

  • markup text, showing “hyperlinks” to click on: this was the original implementation. It is dense and presents well, but slows down quickly when there’s lots of folders.
  • listview control: always fast, but less dense (which is why I used a slightly smaller lettertype for that one - but you can adapt this). This is the current standard setting in the script. (it’s one of the things you can toggle with a dialog button - because its fun to do).

Markup control vs. Listview:

OR

PS. I do wish I could set the background color of the entire listview (on the right) to the same color of the dialog, or to transparent.

Finally, there’s two positions for the dialog (this can also be toggled with a dialog button),

  • Appearance at the cursor location, where you click on your configured Opus button.
  • Appearance to the left of your Opus lister, stretched vertically (you can fine-tune that one in the script parameters) - and there’s another button where you can decide to make the lister “follow” the opened dialog when you drag it. (This was just for the fun of experimenting with the dialog’s move-event).

The parameters are sufficiently documented in the script:

(And yes, I do use some asciii-art in this script).

To end with: I personally use only some 5 buttons with this tool, for locations where this approach suits me very well. It is possible that I’m the only one interested in such an approach - this is unpredictable with such a multifunctional tool like Opus. But hey, we also just share as a sign of appreciation for Directory Opus, isn’t it. And because it’s a community.

History:
v. 1.1 : Initial version.
v.1.2 : added MOVETO option, so the tree view can be used to move files to the chosen location rather than just displaying the folder in Opus.
v.1.4: faster markup version; new 'forward' button (to go to the folder where files were moved)

Import the script via Settings > Install Script:
AltTreeSelect.opusscriptinstall (25.3 KB)

Drag the example button to your toolbar while in customize mode:
Alternative Treeview selection.dcf (737 Bytes).

3 Likes