Page 2 of 3
Re: Wish: Flatten Folder
Posted: 24 Aug 2015 02:06
by Papoulka
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.
Re: Wish: Flatten Folder
Posted: 24 Aug 2015 11:36
by admin
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.
Re: Wish: Flatten Folder
Posted: 24 Aug 2015 20:36
by Papoulka
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.
Re: Wish: Flatten Folder
Posted: 24 Aug 2015 20:46
by admin
It says "focused", not "selected".
But I agree that would be better to use only the selected folder.I will change it.
Re: Wish: Flatten Folder
Posted: 24 Aug 2015 20:52
by bdeshi
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.

Re: Wish: Flatten Folder
Posted: 24 Aug 2015 20:59
by admin
Good point!

Re: Wish: Flatten Folder
Posted: 24 Aug 2015 21:05
by Filehero
OT because of
Code: Select all
If List has focus and a folder is focused in List
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.

Re: Wish: Flatten Folder
Posted: 24 Aug 2015 21:12
by admin
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.
Re: Wish: Flatten Folder
Posted: 24 Aug 2015 21:20
by Filehero
admin wrote:Ha, you don't know what "focused" means.

Some truth in it, otherwise your reply wouldn't have made me look into my list config again ->
Highlight Focused Item was unchecked!
So I think

are deserved - and sufficient.
Thanks.
Re: Wish: Flatten Folder
Posted: 24 Aug 2015 22:48
by LittleBiG
Warning says flattenfolder cannot be undone, but undo works anyway. By the way, undo couldn't create the deleted empty folders.
Re: Wish: Flatten Folder
Posted: 24 Aug 2015 22:57
by admin
No? Strange. I can here.

Re: Wish: Flatten Folder
Posted: 24 Aug 2015 23:52
by Papoulka
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.
Re: Wish: Flatten Folder
Posted: 25 Aug 2015 00:06
by highend
6-7 lines are a complex script?
I think I should only write one liners in the future

Re: Wish: Flatten Folder
Posted: 25 Aug 2015 00:53
by Papoulka
6-7 lines are a complex script?

...But they were
highend lines. Those count differently

. Plus I added clever stuff of my own to make it all "better". Anyway, I used your Flatten script thousands of times and was really glad to have it, so thanks for all you did that way.
Re: Wish: Flatten Folder
Posted: 25 Aug 2015 08:08
by admin
Has anybody (beyond LittleBiG) problems with the Undo of FlattenFolder?