Wish: Flatten Folder
-
Papoulka
- Posts: 455
- Joined: 13 Jul 2013 23:41
Re: Wish: Flatten Folder
Thank you for the function which works very fast compared to scripted alternatives.
However, there is one significant problem: it affixes an increment number to every file moved. I thought it would only do that to resolve a collision, which would be much better.
A minor issue is that if any of the path being flattened is more than 259 chars the command reports that it "can't find" the folder it's being used in. That's a puzzling message. Maybe something more clear is possible.
However, there is one significant problem: it affixes an increment number to every file moved. I thought it would only do that to resolve a collision, which would be much better.
A minor issue is that if any of the path being flattened is more than 259 chars the command reports that it "can't find" the folder it's being used in. That's a puzzling message. Maybe something more clear is possible.
-
admin
- Site Admin
- Posts: 66631
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Wish: Flatten Folder
Always increment: Whoops, that's a bug, of course. Fix comes.
If any of the path being flattened is more than 259 chars: No problem here.
Can you post a screenshot of that message? Maybe I can see where it comes from.
If any of the path being flattened is more than 259 chars: No problem here.
FAQ | XY News RSS | XY X
-
Papoulka
- Posts: 455
- Joined: 13 Jul 2013 23:41
Re: Wish: Flatten Folder
I've now tried a few cases with a ::fresh install of v15.60.0005. The "system cannot find the path specified" error reported earlier was because "Support Overlong Filenames" was disabled. With that enabled, there is no error. .
The only problem I have found with this new version is that it does not operate on the current folder but always one folder deeper. E.g. my folder structure is:
C:\Temp\Flatest\Sub1\Sub2\file.txt
I have C:\Temp\Flatest open in the List pane (and that path appears in the Address Bar). In the List pane I can see the folder "Sub1" but it is not selected. If I run the script it will actually operate on Sub1. The resulting structure is C:\Temp\Flatest\Sub1\file.txt. But I want it to be C:\Temp\Flatest\file.txt. I get the same result if I run
From the log notes, I understand that Flatten() will operate on Sub1 if that folder is selected. But with nothing selected and/or with <curpath> specified, I think it should flatten the current (open in List pane) folder.
BTW, the safety prompt still says there is no Undo. The Undo is way cool.
Thanks for all the work on this.
The only problem I have found with this new version is that it does not operate on the current folder but always one folder deeper. E.g. my folder structure is:
C:\Temp\Flatest\Sub1\Sub2\file.txt
I have C:\Temp\Flatest open in the List pane (and that path appears in the Address Bar). In the List pane I can see the folder "Sub1" but it is not selected. If I run the script
Code: Select all
flattenfolder(, "");Code: Select all
flattenfolder(<curpath>, "");BTW, the safety prompt still says there is no Undo. The Undo is way cool.
Thanks for all the work on this.
Last edited by Papoulka on 24 Aug 2015 20:50, edited 1 time in total.
-
admin
- Site Admin
- Posts: 66631
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Wish: Flatten Folder
It says "focused", not "selected".
But I agree that would be better to use only the selected folder.I will change it.
But I agree that would be better to use only the selected folder.I will change it.
FAQ | XY News RSS | XY X
-
bdeshi
- Posts: 4256
- Joined: 12 Mar 2014 17:27
- Location: Asteroid B-612
- Contact:
Re: Wish: Flatten Folder
regarding overwrite security, consider replacing the s flag with say, x, to turn OFF that prompt.
That will take a conscious effort from the scripter's part to avoid that step.
Right now, I might use any flag, forget s, therefore override it and make a mess.
With 'x', I'll have to specifically type it in when trying to skip the prompt. No punishment for forgetfulness.
That will take a conscious effort from the scripter's part to avoid that step.
Right now, I might use any flag, forget s, therefore override it and make a mess.
With 'x', I'll have to specifically type it in when trying to skip the prompt. No punishment for forgetfulness.
Icon Names | Onyx | Undocumented Commands | xypcre
[ this user is asleep ]
[ this user is asleep ]
-
admin
- Site Admin
- Posts: 66631
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
Filehero
- Posts: 2734
- Joined: 27 Feb 2012 18:50
- Location: Windows 11@100%
Re: Wish: Flatten Folder
OT because of
Is this ever possible? Over here, if a defocused list has a focused folder this folder will become selected when the list regains focus.
I expect to add some
soon. 
Code: Select all
If List has focus and a folder is focused in ListI expect to add some
-
admin
- Site Admin
- Posts: 66631
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Wish: Flatten Folder
Ha, you don't know what "focused" means.
In each list exactly one item must have the focus. This is totally independent of any selections. The focus controls which item is affected by keyboard action, that's all.
In each list exactly one item must have the focus. This is totally independent of any selections. The focus controls which item is affected by keyboard action, that's all.
FAQ | XY News RSS | XY X
-
Filehero
- Posts: 2734
- Joined: 27 Feb 2012 18:50
- Location: Windows 11@100%
Re: Wish: Flatten Folder
Some truth in it, otherwise your reply wouldn't have made me look into my list config again -> Highlight Focused Item was unchecked!admin wrote:Ha, you don't know what "focused" means.
So I think
Thanks.
-
LittleBiG
- Posts: 1848
- Joined: 08 Apr 2011 12:57
- Location: Win10x64
Re: Wish: Flatten Folder
Warning says flattenfolder cannot be undone, but undo works anyway. By the way, undo couldn't create the deleted empty folders.
-
admin
- Site Admin
- Posts: 66631
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
-
Papoulka
- Posts: 455
- Joined: 13 Jul 2013 23:41
Re: Wish: Flatten Folder
This is great! Runs slick, replacing a complex script (given to "UDF can't call itself" failures) AND an über-clunky AutoIt adjunct exe. Much appreciated.
-
highend
- Posts: 14993
- Joined: 06 Feb 2011 00:33
- Location: Win Server 2022 @100%
Re: Wish: Flatten Folder
6-7 lines are a complex script? 
I think I should only write one liners in the future
I think I should only write one liners in the future
One of my scripts helped you out? Please donate via Paypal
-
Papoulka
- Posts: 455
- Joined: 13 Jul 2013 23:41
Re: Wish: Flatten Folder
...But they were highend lines. Those count differently6-7 lines are a complex script?
-
admin
- Site Admin
- Posts: 66631
- Joined: 22 May 2004 16:48
- Location: Win8.1, Win10, Win11, all @100%
- Contact:
Re: Wish: Flatten Folder
Has anybody (beyond LittleBiG) problems with the Undo of FlattenFolder?
FAQ | XY News RSS | XY X
XYplorer Beta Club