The list of filenames, which the third prompt requests, is just a text file with one filename (and its extension) per line.
I didn't post that source AppleScript as I should have, and the hosting software removed some needed spacing in the code causing it to not compile in Apple's Script Editor. Here is the correct code posting:
property defloc : (path to desktop as text) as alias
property msg1 : "Select the input folder"
property msg2 : "Select the output folder"
property msg3 : "Select the input file with filenames"
use scripting additions
set name_list to {}
set match_list to {}
try
set infolder to (choose folder with prompt msg1 default location defloc without invisibles, multiple selections allowed and showing package contents)
set outfolder to (choose folder with prompt msg2 default location defloc without invisibles, multiple selections allowed and showing package contents)
set name_file to (choose file with prompt msg3 default location defloc without invisibles, multiple selections allowed and showing package contents)
display dialog infolder's POSIX path & return & outfolder's POSIX path & return & name_file's POSIX path
-- read names from file into quoted filename list
set name_list to read name_file as «class utf8» using delimiter linefeed
tell application "Finder"
-- get every filename in infolder hierarchy whose filename matches names in name list
set match_list to (every item of entire contents of folder infolder whose name is in name_list) as alias list
-- copy the files to outfolder with exact permissions and overwrite if required
repeat with anItem in match_list
duplicate anItem to outfolder with replacing and exact copy
end repeat
end tell
on error errmsg number errnbr
my error_handler(errnbr, errmsg)
end try
return
on error_handler(nbr, msg)
return display alert "[ " & nbr & " ] " & msg as critical giving up after 10
end error_handler
The choice of folders should not be sub-folders within an existing folder, just the parent folder on the Desktop. See if this revised code resolves copying files to that outfolder.