Moving Files.

Please Help!!

I’m trying to move the contents of several folders in to one folder. But I there could be duplicate copies of files. The duplicates I want to move to a second folder called duplicates.

Here is my code so far:

on run
	tell me to open {choose folder with prompt "Please select the folder containing files you wish move."}
end run

on open myFinderList
	repeat with myFinderItem in myFinderList
		tell application "Finder" to set myItemIsFolder to (kind of myFinderItem = "folder")
		if myItemIsFolder then
			tell application "Finder" to set myFolderContents to (every item of myFinderItem)
			open myFolderContents
			tell application "Finder"
					move myFinderItem to folder "Out"
				on error
					move file to folder "Duplicate"
				end try
			end tell
		end if
	end repeat
end open

If I run the script it errors on the line :- move file to folder “Duplicate”
and the error message reads:- Finder got an error: Handler can’t handle objects of this class.

Can someone please tel me what I’m doing wrong?

Kind regards

Does it help if you change:

move file to folder “Duplicate”


move myFinderItem to folder “Duplicate”



You are a star!! worked a treat.