Originally published on 2017-11-29

Small snippet, useful when required to duplicate a given file n times

tell application "Finder"
set sourceFile to choose file with prompt "Please select directory."
display dialog "Input times" default answer "" buttons {"OK"} default button 1
set theAnswer to (text returned of result)
repeat with i from 1 to theAnswer
duplicate file sourceFile
end repeat
end tell