Move files based on their type to different folders

I'm wanting to set up a button to move files, based on their type, to different folders, eg all *.JPG files to a folder named Photos; and all *.MP4 files for a folder named Moves.

I'm using the following code, but it's a bit primitive. Can someone help me simplify it? Thank you so much!

Select *.jpg
Clipboard CUT
CreateFolder NAME=Fotos READAUTO
Clipboard PASTE
Go ..
Select *.mp4
Clipboard CUT
CreateFolder NAME=Moves READAUTO
Clipboard PASTE
Go ..

You only need the copy command for this. It can take wildcards and create destination folders.

There's almost never any need to use the Select command to change what another command will run on, nor to navigate to other folders to change which folders things run from or to.

1 Like

Thanks @Leo!

Select *.jpg
Copy MOVE HERE CREATEFOLDER Photos
Select *.mp4
Copy MOVE HERE CREATEFOLDER Moves

No need to use Select here. Copy is all you need.

1 Like

Thank you very much @Leo, now it's better!

Copy MOVE *.jpg HERE CREATEFOLDER Photos
Copy MOVE *.mp4 HERE CREATEFOLDER Moves
Copy MOVE *.(doc|docx) HERE CREATEFOLDER Word
Copy MOVE *.pdf HERE CREATEFOLDER PDF
Copy MOVE *.txt HERE CREATEFOLDER TXT
Set VIEW=Thumbnails
1 Like