Extract/flatten folder, moving files into current directory

Hi all, I have two buttons I use to "defolder" - by selecting a folder and then pressing the button, the contents are moved to the current directory and the selected folder deleted.

The following button has stopped working since the last couple of updates:

@dironly @nofilenamequoting Copy MOVE "{f!}\." TO "{f!|..}"

When this stopped working I started to use:

Copy EXTRACT HERE Delete QUIET

This latter button works fine, but I'm wondering, why has the first button stopped working? The reason I'm asking is because I wanted to modify it so that all files in all subfolders were moved to the current directory, no matter how deep the folder structure is. Any ideas on how to accomplish this?

The first button doesn't really make sense. SomeFolder. is the same as SomeFolder (every folder has a special "." directory within it which points back at the folder itself). So the button is telling Opus to move a folder to the parent of that folder, but that's where the folder already is (by definition) so there's nothing to be done.

If you change the . to a * and it should work. Then you've moving everything inside the folder (rather than the folder itself) to the folder's parent.

BTW, some related buttons are here: Quick buttons for directory organisation. There are a couple of buttons in that thread which move everything from the current folder up a level. (Different to yours which moves things out of the selected folder. Just thought I'd mention that thread in case it was of interest.)

Hi Leo, you're right - changing the "." to "*" worked! But I guess after reading the post you linked to there's no easy way to achieve the complete flattening of a folder (including all subfolders) with a button. I tried your dirflatten tool but I can't seem to get it working. I guess for now I"ll just resort to flatview and then select and move.

BTW, the strange thing about changing the "." to "*" is that in the following post that first button using "." was the only solution to "defolder" when the extract here command wasn't working (in previous versions).

[url]Extract HERE not working]

It's strange that at that time the "." was fine in the code, but for some reason now it's not.