Copy files from one folder to another folder using a text file list
I am trying to copy files that match a list of file names in a text file from one folder to another.
This is what I have so far. The problem is that the event times out. What am I missing and can someone help?
set listFile to POSIX path of (choose file)
set dataList to paragraphs of (read listFile as «class utf8»)
tell application "Finder"
set ImageFile to "Macintosh HD:Users:Myuser:Pictures:Pictures 1"
set theFolder to "Macintosh HD:Users:Myuser:Pictures:Images"
repeat with thisFileName in dataList
duplicate (files of folder ImageFile whose name begins with thisFileName) to theFolder
end repeat
end tell
iMac, OS X Yosemite (10.10.3)