How to move files to specifics folders based on extensions

This thread might be interesting, you could check JohnZemans code:

[Sending files automatically to appropriate collections?)