How can I easily batch flattenfolder?
I just want to select a bunch of folders and XY flatten to my root folder. I wanna to flatten on inside the folders that I selected. Not one by one
Like this:
Root (where I am)
- [asset 01]
--- [maps]
------ file 01
------ file 02
--- [example]
----- file 03
----- file 04
- [asset 02]
--- [maps]
----- file 05
----- file 06
--- [example]
----- file 07
----- file 08
I want to compact, selecting folders [asset 01] and [asset 02] and flatten inside, like this:
- [asset 01]
--- file 01
--- file 02
--- file 03
--- file 04
- [asset 02]
--- file 05
--- file 06
--- file 07
--- file 08
Batch flatten folder
-
admin
- Site Admin
- Posts: 67337
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Batch flatten folder
Check out "Flatten Folder" here: Configuration | General | Menus, Mouse, Usability | Context Menus | File List...
Not entirely sure what you want, so make some tests before you start the serious stuff.
Not entirely sure what you want, so make some tests before you start the serious stuff.
FAQ | XY News RSS | XY X
-
Norn
- Posts: 522
- Joined: 24 Oct 2021 16:10
Re: Batch flatten folder
It's in the 32-bit context menu. . .
To see the attached files, you need to log into the forum.
Windows 11 24H2 @100% 2560x1440
-
admin
- Site Admin
- Posts: 67337
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Batch flatten folder
Ah yes.
For those using the 64-bit context menu there is also a scripting command
For those using the 64-bit context menu there is also a scripting command
flattenfolder().FAQ | XY News RSS | XY X
-
Theodecarvalho
- Posts: 49
- Joined: 17 Jul 2022 11:59
Re: Batch flatten folder
I want to flatten several folders, but keeping the root of each one. I mean... I need to batch the flaten folder command to hundreds of folders.
If I use the tree, flatten folder appears. But I cant select more than one. (This is my try to batch) If I select one or several folders, I cant batch flatten folder, it wont appear btw, flatten is turned on. I looked for an old post explaining the procedure. .
I thinks its simple, for you, just use flatten folder to a hundreds of folders (without combine them).
Thanks.
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: Batch flatten folder
A simple script does that^^
Code: Select all
$roots = regexmatches(<get SelectedItemsPathNamesSlashed>, "^.*?\\$", <crlf>);
end (!$roots), "No folder(s) selected, aborted!";
showstatus 0;
$cntRoots = gettoken($roots, "count", <crlf>);
while ($i++ < $cntRoots) {
$root = gettoken($roots, $i, <crlf>);
status "Flattening $i / $cntRoots", , "progress";
flattenfolder($root, "n");
}
status "All flattening done...";
One of my scripts helped you out? Please donate via Paypal
-
Theodecarvalho
- Posts: 49
- Joined: 17 Jul 2022 11:59
Re: Batch flatten folder
Thanks. It works when I run "try script"
I saved in BATCHFLATTENFOLDER.XYS and now im struggling to make it easy access, even in context menu or Catalog.
I found this topic: viewtopic.php?t=3613 from 2009, but I tried several lines and none worked
load "D:\PROGRAMAS\XYplorer 23.00.0100\BATCHFLATTENFOLDER.XYS";
::load "D:\PROGRAMAS\XYplorer 23.00.0100\BATCHFLATTENFOLDER.XYS";
::load 'D:\PROGRAMAS\XYplorer 23.00.0100\BATCHFLATTENFOLDER.XYS';
I saved in BATCHFLATTENFOLDER.XYS and now im struggling to make it easy access, even in context menu or Catalog.
I found this topic: viewtopic.php?t=3613 from 2009, but I tried several lines and none worked
load "D:\PROGRAMAS\XYplorer 23.00.0100\BATCHFLATTENFOLDER.XYS";
::load "D:\PROGRAMAS\XYplorer 23.00.0100\BATCHFLATTENFOLDER.XYS";
::load 'D:\PROGRAMAS\XYplorer 23.00.0100\BATCHFLATTENFOLDER.XYS';
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Batch flatten folder
Screenshot from the properties of that catalog entry?
Screenshot of the full file location of the .xys script?
Screenshot of the full file location of the .xys script?
One of my scripts helped you out? Please donate via Paypal
-
Theodecarvalho
- Posts: 49
- Joined: 17 Jul 2022 11:59
-
highend
- Posts: 15016
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Batch flatten folder
The Action on Click must be "Go to Location", not "Open item"
One of my scripts helped you out? Please donate via Paypal
-
Theodecarvalho
- Posts: 49
- Joined: 17 Jul 2022 11:59
Re: Batch flatten folder
Thanks! It almost works flawless.
When I use it with a few folders, works fine. But, sometimes, when I got several folders (I didn´t identify the amount preciselly) It appears an error:
BTW: I got travel for work, so I couldn´t test before I come back.
To see the attached files, you need to log into the forum.
XYplorer Beta Club