FWIW, if you're eager to try out the version with this included, feel free to send me a message to get it.
Hi!, first of all, what an incredible script, thank you for this.
I want to ask you about this one. I regularly use this command ExpandFolders TOGGLE
and recently ExpandFolders TOGGLE=expandtop
, the thing is that when nothing is selected and hit ExpandFolders TOGGLE
it expands all of the folders on the lister (as expected) and when hit it again with a folder selected it collapses it (again as expected), but then when i hit ExpandFolders TOGGLE=expandtop
with a folder selected it expands all of the folders inside. I would expect to just expand it on the first level (in the example below, to not expand the audio folder). Is there a way to change it's behavior?
Thanks.
Thank you!
At least in my tests, that doesn't happen. Make sure that Preferences / File Displays / Folder Expansion > Collapse subfolders within collapsed folders
is checked, as otherwise, when collapsing folders, not all levels may close. (the command respect that option).
Ah, that was it, TY!
v2.0.0 (May 13, 2024):
- Added new arguments:
SNAPSHOT
: Allows saving the current state of a path, related to expanded/collapsed folders state and the focused item (depending on the configuration). Can be used with other arguments.SNAPSHOT=restore
: Allows restoring a previously saved state, along with the focused item (depending on the configuration). Cannot be used with other arguments.CLEARSNAPSHOTS
: Deletes ALL currently saved snapshots.
- Enhanced the collapsing part. It now detects whether
Preferences / File Displays / Folder Expansion > Collapse subfolders within collapsed folders
is disabled and collapses all levels accordingly, even in that scenario. - New entries in Script Configuration:
Clear Snapshots after X days
andFocus when restoring
(both explained in Configuration). - Other minor corrections.
Hi!, great update, one thing tho, apparently i can no longer toggle in folders that are not on the same level, i recorded a video comparing 1.6 vs 2.0
Video
Thank you very much for noticing! Corrected and re-uploaded as v2.0.1.
How do you run: 'Prefs SCRIPTINSTALL' ?
EDIT:
Never mind. I created a new command and ran it in there, then deleted it.
But is there a normal place to run commands? Like cmd in windows?
It's also part of the default toolbars, in the Settings menu. (Customize > Default Toolbars, if your toolbars are customized based on an old version and don't have it yet.)
You can run ad-hoc commands by typing >
into the file display, or via Tools > Opus CLI / Ad-Hoc Script Editor.
How exactly we can do that? Can you elaborate?
Not sure I can, at least in words rather than a video or something. Which part is unclear?
Forget it Leo. I have found it. Thanks.
IMPORTANT: Needs at least v13.7.5
v2.1.0 (Jul 12, 2024) :
- Improved internal script intercommunication thanks to new additions in DO.
- The script can now be used simultaneously in each lister.
- Other minor improvements.
Ok this is frikkin epic times two (Ex2).
I'm trying to follow along, but it's unclear to me how to configure it.
My goal: Three-button: left click will expand by one level at a time, indefinitely. Not just top level or an absolute level. Situational, so whatever level it's currently at, +1 it (relative). I'm not seeing that here. Right click same, collapse by one level, mm button collapse all.
I can get the collapse all, but...
Keep reading and you’ll eventually get to it
Which part is not clear?
ExpandFolders EXPAND=top
By first level
I meant relative to the target folder, not the top-main-branches.
With the collapse, I think it always works one level at a time???
But you probably have to select the target folders first; otherwise, you’ll end up collapsing the top branches and, by definition, all their sub-branches.
The modifier "top". If I am at the base level, nothing selected and use this, it will expand all by one level. And then nothing selected will expand the second level. Ok, this is already better than the factory code, that wasn't doing that. But if I choose a second level folder that is the new parent target. ? Because clicking a folder and then pushing this button no longer does anything.
Also having to choose collapse targets is problematic. It's ideal that if nothing is selected it will assume the user wants to collapse all by one level at a time, not a full collapse. That's what the middle mouse button is reserved for. A "collapse all" command. Can it determine the deepest currently open level and use that as the relative parent, to know to collapse by one level?
Hmmm...Yes, because Test
is already expanded to the first level. If you want to expand Test 2
, you either need to select it first or add SELECT=dirs
when expanding Test
.
If you think it through, it's not. When nothing is selected, the command assumes you want to use "all". Otherwise the command would have to first count all the levels to the deepest one at first (which means time wasted just in counting), then start to rollin back one level at a time, which usually means collapsing things you don't want to/know IMO (because you're not going to manually count the levels)
The thing about choosing targets is clicking on a folder, well the arrow is right there. There's no point setting up a shortcut if it's the same steps. But it would be super helpful if you select a folder and that is the new base (top level) for these shortcuts.
As per my original post I'm looking for a basic up/down in all circumstances. If you're worried the folders would get out of sync in their levels, well that doesn't matter. If a folder structure currently has these depths:
3
2
2
3
Going up one level would result in this:
2
1
1
2
At the first level being told to collapse it wouldn't do anything, but still anything open goes up one. Down (expand) would be the same principle.
Expanding, collapsing is fundamental so I put it on my mouse. Which is boardwalk real estate; there are like a dozen shortcuts that didn't make the cut; competing for the most useful spots. Here's a legend.
Similar scheme to anything with tabs, like chrome, for muscle memory.
So I put the Expand=top as Alt + J shortcut. Added it directly to the button. Then I made a standalone "lister key", that is the Expand (all). Ctrl + Alt + J. So I can press the mouse button to go down one level (expand 1). Hold Ctrl, push the same button and it will process the hotkey command instead of the button command, to expand all. Same with collapse (Alt + G) and the viewer pane (Alt + M). This is an old MIDI processing trick for coarse/fine adjustments.
But the collapse one level is a bummer.
Afaik, you can't press multiple arrows at the same time.
I see that you could actually expand by levels without changing the target, but it involves using Evaluator, tab variables and things like that. Perhaps too much effort.
Regarding the reverse collapse, I imagine that in certain scenarios could be helpful, but for the moment I have no intention of expanding the command. Sorry if that leaves you in the cold.
That's not how the command work. If you read some posts above, you'll see that some user were complaining about the speed at which the command worked. With the reverse collapse I imagine there would be more complaints . TBH it doesn't sound appealing to me at all.