problem transferring files from multiple folders

Hello all,

I have set up this basic script to transfer all the files from all the folders within a given folder to another separate folder. I am trying to get rid of the folder structure by doing this.

tell application “Finder”
select every file of every folder of folder “001” of startup disk
duplicate selection to folder “test” of startup disk
end tell

----folder “001” has several folders within it, each containing 9 files.

when I execute the script it only duplicates/moves/copies the files from the first folder in folder “001”.

I get the same result if I use copy or move in place of duplicate.

Can someone help me understand why this is happening and a possible fix?

Thanks so much for your help and any suggestions!

Frank

tell application "Finder"
	set folder_list to every folder of folder "001" of startup disk
	repeat with the_folder in folder_list
		duplicate every file of the_folder to folder "test" of startup disk
	end repeat
end tell

But, you should consider what do you want to do if there were any files which have same names in those folders.