Automated command ; extracting files from folders and copying them into a single folder

Hello everyone,

I'm running Mac OS X Leopard (10.5.8) and I want to use the Terminal to help automate this tedious and laborious command for me:

I need to extract all of the .m4p files in my "iTunes Music" folder which reside in folders of the artist, and then subfolders for the albums and then copy those .m4p files to a single folder elsewhere. I also need to exclude the folders "Movies" and "TV Shows" from the copying process.

Would someone be able to educate me as to how I would go about automating such a task?

Thanks!!

BOSS

find $HOME/Music/iTunes/iTunes\ Music/ -type f -iname "*m4p" -print0 | xargs -0 -J% cp % /path/to/destination/directory/

You might have to tinker with the iTunes Music path.

This could easily be accomplished with Automator.

I highly recommend going to youtube and check out tutorials, especially for beginners it's a lot easier than getting down to shell scripting.