Understanding "Flatten Folder"

Please check the FAQ (https://www.xyplorer.com/faq.php) before posting a question...
Irwin of Upton
Posts: 131
Joined: 28 Feb 2015 19:42

Understanding "Flatten Folder"

Post by Irwin of Upton »

Is this correct?

The idea with Flatten Folder to get a Branch View but on a permanent basis?

Want to know for sure before doing something regrettable.

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

Re: Understanding "Flatten Folder"

Post by highend »

It will move all files from all subdirectories from the selected folder (tree or list) into the selected folder itself and delete all emtpy subfolders of it afterwards... There are no branches left, so that's no branch view xD
One of my scripts helped you out? Please donate via Paypal

Irwin of Upton
Posts: 131
Joined: 28 Feb 2015 19:42

Re: Understanding "Flatten Folder"

Post by Irwin of Upton »

Putting the terminology aside, the Flatten Folders is doing just what was hoped for. But how to make it into a toolbar button as it doesn't seem to be issued a command number?

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

Re: Understanding "Flatten Folder"

Post by highend »

It exists also as a scripting command "flattenfolder()"
v15.60.0004 - 2015-08-23 21:09
+ Scripting got a new function.
Name: FlattenFolder
Action: Flattens a folder.
Syntax: flattenfolder([folder], [separator=CRLF], [flags])
folder: (optional) Folder to flatten.
If missing then:
If List has focus and a folder is focused in List, then
this folder is flattened.
Else: Defaults to the current folder.
separator: Separates the items in the return value.
flags: (bit field)
1 = No prompt.
return: List of contents of the folder after being flattened; items with
full path, separated by separator.
Remarks:
- The function will auto-avoid filename collisions by affixing
increments to the new name according to the user settings
(Configuration | Templates | Filename Affixes).
- No Undo!
- Warning: This command can easily destroy a complex folder structure.
Therefore a safety prompt has to be OK-ed before the rumble begins
(unless you pass flag 1).
Examples:
flattenfolder(); //flatten current folder
flattenfolder(,,1); //same, but without prompt
text flattenfolder(); //show return value
echo flattenfolder("E:\Test\flatten-01", "|");
One of my scripts helped you out? Please donate via Paypal

Irwin of Upton
Posts: 131
Joined: 28 Feb 2015 19:42

Re: Understanding "Flatten Folder"

Post by Irwin of Upton »

Hello highend - Thanks for pointing to "flattenfolder()". At the moment scripting is "above my pay grade". Plugging a command number into the button would have been nice but that wasn't meant to be.

admin
Site Admin
Posts: 64916
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Understanding "Flatten Folder"

Post by admin »

Don't know about your pay grade, but this does not look too hard to me:
Attachments
2015-09-01_165357.png
2015-09-01_165357.png (5.14 KiB) Viewed 9826 times

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

Re: Understanding "Flatten Folder"

Post by highend »

"above my pay grade"
-> No scripting^^
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 64916
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Understanding "Flatten Folder"

Post by admin »

The skill you need here is rather pasting than scripting. :)

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

Re: Understanding "Flatten Folder"

Post by highend »

No, what he probably meant: No pro version = no scripting available...
One of my scripts helped you out? Please donate via Paypal

admin
Site Admin
Posts: 64916
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Understanding "Flatten Folder"

Post by admin »

Oh, now I got it... :oops: :whistle:

Irwin of Upton
Posts: 131
Joined: 28 Feb 2015 19:42

Re: Understanding "Flatten Folder"

Post by Irwin of Upton »

Using a script word without having to write a script! Now I've seen everything.

Thanks fellas ...

Irwin of Upton
Posts: 131
Joined: 28 Feb 2015 19:42

Re: Understanding "Flatten Folder"

Post by Irwin of Upton »

With the help of those above it has been possible to assemble a toolbar button to Flatten Folders.

For those who may be interested here is a link to the icon chosen to do this after an internet search. It proclaims the function nicely. http://www.iconarchive.com/show/flat-fo ... -icon.html

admin
Site Admin
Posts: 64916
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Understanding "Flatten Folder"

Post by admin »

Cool. So you *have* the paid version with scripting?

Irwin of Upton
Posts: 131
Joined: 28 Feb 2015 19:42

Re: Understanding "Flatten Folder"

Post by Irwin of Upton »

Yes. Being new and timid and somewhat unsure about dealing with a company in Germany my Forum name is a nom de plume to keeps things separate from the program registered name. To invoke a saying, "Just because you are paranoid doesn't mean someone isn't out to get you". Dark humor.

admin
Site Admin
Posts: 64916
Joined: 22 May 2004 16:48
Location: Win8.1, Win10, Win11, all @100%
Contact:

Re: Understanding "Flatten Folder"

Post by admin »

:biggrin: :tup: :ghost:

Post Reply