Expand Multiple Folders

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Post Reply
mrbosco
Posts: 141
Joined: 03 Sep 2011 09:40

Expand Multiple Folders

Post by mrbosco »

Is there a quick way to expand multiple folders one level?
IOW, from the root folder I'd like to select several folders and have the tree open up the selected folders one level?

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Expand Multiple Folders

Post by highend »

One of my scripts helped you out? Please donate via Paypal

mrbosco
Posts: 141
Joined: 03 Sep 2011 09:40

Re: Expand Multiple Folders

Post by mrbosco »

I'm not really looking for a branch view where all the files are combined.
I'm trying to have a tree format where all of the original folders are opened one level.

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Expand Multiple Folders

Post by highend »

You mean from this:
1.png

to this:
2.png

?
To see the attached files, you need to log into the forum.
One of my scripts helped you out? Please donate via Paypal

mrbosco
Posts: 141
Joined: 03 Sep 2011 09:40

Re: Expand Multiple Folders

Post by mrbosco »

From your Program Files example I would like the left side to open crucial, dotnet and the rest of the folders opened as if each branch was clicked on. I would really like if several selected folders would do the same thing.

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Expand Multiple Folders

Post by highend »

Then show your screenshots with three selected folders a.) before and b.) after <whatever should be done there>
One of my scripts helped you out? Please donate via Paypal

mrbosco
Posts: 141
Joined: 03 Sep 2011 09:40

Re: Expand Multiple Folders

Post by mrbosco »

In the Before screenshot I'd like to select Folder's C and D.

I'd like to do some command to easily wind up with the after where the left side is expanded without having to double click each individual folder (C and D)
To see the attached files, you need to log into the forum.

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Expand Multiple Folders

Post by highend »

And what exactly is different in your example in comparison to my screenshots? oO

I selected three folders and they were opened up in the tree for only one level...

Write a script that loops over the selected folders, get the subfolders of these folders and use showintree for the first subfolder (for each folder)...
One of my scripts helped you out? Please donate via Paypal

mrbosco
Posts: 141
Joined: 03 Sep 2011 09:40

Re: Expand Multiple Folders

Post by mrbosco »

You are correct. I was a bit confused about the before and after in your example.
I'm sort of a novice when it comes to writing scripts.
Can you please show me an example?

highend
Posts: 15016
Joined: 06 Feb 2011 00:33
Location: Win Server 2022 @100%

Re: Expand Multiple Folders

Post by highend »

Code: Select all

    $items = <get SelectedItemsPathNames <crlf>>;
    foreach($item, $items, <crlf>, "e") {
        if (exists($item) == 2) {
            $subFolder = quicksearch("/n /d /limit=1", $item);
            if ($subFolder) { showintree $subFolder; }
        }
    }
One of my scripts helped you out? Please donate via Paypal

mrbosco
Posts: 141
Joined: 03 Sep 2011 09:40

Re: Expand Multiple Folders

Post by mrbosco »

Perfect! Thank you! Been trying to figure out how to do this for a long time.
Glad I asked,

Post Reply