Solution to save lister tab's "snapshot" for restoring purpose

Hi gurus, I am wondering is there a solution or workaround to achieve saving a "snapshot" of the current tab.
In detail, if we have a tab like following:
As we can easily see, some folders are expanded and some are not. I call this general picture as a "snapshot".
I want capability to restore this exact "snapshot" when I reopen Opus app after existing.
I really don't know how to achieve this, but my intuition tells me there is a high chance that this can be done.
Thanks, gurus!

I don’t think the expansions can be remembered at the moment. (They can in the folder tree, but not the file display.)

At least in terms of what’s currently built-in. I think you could have a script which saved and restored the expansions,

Thanks Leo, your mention of using script is what I have in mind. But I just can not figure out how to accomplish this?
My straightforward thought is maintaining a file that saves the snapshot, and which can also be loaded by a button click to restore the snapshot.

Easiest way I can think of from a script is to loop through the items in the file display for any with item.nested set, which tells you their parent folder is expanded, and save the list of folders to a file. The go expandfolder command can then be used to expand those folders again.

Only problem with that is it will not notice folders which are expanded but empty. I'm not sure if there is currently a fast way to check for those.

Ok, how to use "go expandfolder" command exactly? I can not find any example demonstrating using it.

I guess that was just a typo :slight_smile:


Thanks very much, finally I can see the big picture.
BTW, I can not think of a proper way using saved folders file in combination with "go expandbranch" command to restore the "snapshot". It is not like that I can simply pass the fullpath of saved folders to some command and make them all expanded.
Is there a relatively easy way to do this? I am eager to hear your advice.

That is pretty much what you would do.

:sweat_smile:Thanks, indeed a practical advice.