Help duplication files from one folder to another

This is the code I have:

tell application “Finder”
set fromFolder to fileStructureToCustomer & “Proofs:” as alias
set ToFolder to fileStructureToCustomer & “PictureShow:” as alias
duplicate every file of folder (fromFolder as string) to folder (ToFolder as string)
end tell

but I am getting the error

File Macintosh HD:users:Rupert:desktop:baird:customers:Chris Humphreys:Proofing:Tracy Scott Baird - Tracy Baird:Proofs: wasn’t found. (-43)

What I don’t get is that it acts like it is trying to find the file named above in error message, but that is the folder. I want to copy everything from the fromfolder to ToFolder.

I was able to make your script work by removing both instances of “as alias.”

Alternately, you can do the following:

do shell script “cp ~/whatever/* ~/whatever2/”

replacing ~/whatever/ with the source folder and ~/whatever2/ with the destination folder.

Yeesh! That will strip the resource fork information as well as the HFS+ metadata. Not a big deal with text files, but if we’re talking about fonts and graphics, it’s a different matter.

Better to use “ditto --rsrc” instead, which will preserve everything.

Hope this helps…

if there’s files with duplicate names does it overwrite them?