Organize files into folders based on their extension

I have created a button with the following code to organize files into subfolders based on their extension:

Copy MOVE *.(docx|xlsx|pdf|txt) HERE CREATEFOLDER DOCUMENTS
Copy MOVE *.(jpg|png|bmp|gif) HERE CREATEFOLDER IMAGENS
Copy MOVE *.(mp3|ogg|aac|wma) HERE CREATEFOLDER AUDIO
Copy MOVE *.(mp4|mov|wmv) HERE CREATEFOLDER VIDEO

But it happens that, the first folder (DOCUMENTS) is created fine, but the other folders (IMAGES, AUDIO and VIDEO) are created inside DOCUMENTS. Could someone help me so that the 4 folders are created at the same hierarchy level? Thank you so much

Seems like adding some GO UP command between the lines doesn't work. It would require something like a new WAIT= or @waituntilfinished command.

But adding a few @confirm lines inbetween could be used as a workaround, i suppose.

That looks like a bug.

Try changing HERE to TO {sourcepath$} as a workaround.

1 Like

Thank you @abr for your help, I had already tried with GO UP, but it doesn't work, and using @confirm the process would not be automatic

Thank you very much @Leo, it worked with your replacement, anyway, as you suggest, perhaps it is a bug, because in OPUS 12, that button worked fine!

Fixed for the next beta.

3 Likes