I'm having problem on how to duplicate a list of files
of a folder based on a file name and creation date and I keep getting an error of "Can't make some data to expected type."
I tried:
set fileNameCriteria to "NewsStatic"
set dateCriteria to the (current date) - 7 * days
set htmlFolder to (path to desktop as string) & "Static HTML Folder" as alias
set targetFolder to (path to desktop as string) & "Uploads Static HTML" as alias
tell application "Finder"
duplicate (every file of folder htmlFolder whose ((name starts with the fileNameCriteria) and (creation date is less than the dateCriteria)))
end tell
Any ideas what I'm doing wrong....
thanks...