試す:
set myValues to {"3101", "3102", "3103", "3456", "6789"}
tell application "Finder" to set fileList to files of target of front window
set matchedFiles to {}
repeat with aFile in my fileList
repeat with aValue in myValues
tell application "System Events" to if aFile's name contains (contents of aValue) then set end of matchedFiles to (aFile as text)
end repeat
end repeat
tell application "Finder" to select matchedFiles
編集 - Finder ウィンドウと regulus6633 の提案を追加:
set myValues to {"3101", "3102", "3103", "3456", "6789"}
tell application "Finder" to set fileList to files of target of front Finder window as alias list
set matchedFiles to {}
repeat with aFile in my fileList
repeat with aValue in myValues
tell application "System Events" to if aFile's name contains (contents of aValue) then set end of matchedFiles to (aFile as text)
end repeat
end repeat
tell application "Finder" to select matchedFiles
編集2
set myValues to {"3125", "3123"}
tell application "Finder" to set fileList to files of target of front Finder window as alias list
set matchedFiles to {}
repeat with aFile in my fileList
repeat with aValue in myValues
tell application "System Events" to if aFile's name contains (contents of aValue) then set end of matchedFiles to (aFile as text)
end repeat
end repeat
if matchedFiles ≠ {} then
tell application "Finder"
select matchedFiles -- you don't need to select files to duplicate them
duplicate matchedFiles to (choose folder)
end tell
end if