Take a look at Big Mean Folder Machine. It can do what you asked including resolving potential filename conflicts. Free trial, so you can give it try before buying. So much easier than manually moving files or debugging a script. Here's a basic description of how BMFM merges multiple folders:
Merging several file collections in a single folder
Sometimes, rather than needing to create a new file organization, you need to "un-wind" an existing one. In this case, your files are spread over several source folders and/or subfolders and you wish to place them all into one "big" folder.
The main challenge in doing this, aside from the tedious manual dragging and dropping of files, arises from the
possibility of "file name conflicts", i.e. several files may share the same name and the Finder will
refuse to let you move the files until you given them a unique name.
The basic steps involved in merging two or more folders or folder hierarchies are:
- Select the folder(s) that contain(s) the files you want to merge
- Select a file conflict resolution scheme
- Select a destination folder
The Big Mean Folder Machine will take care of the rest.
I use it as well as other apps from the same developer ... A Better Finder Rename, A Better Finder Attributes and Nifty File Lists. They're all nicely designed and work perfectly.