Originally published on 2017-11-29
Small snippet, useful when required to duplicate a given file n times
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |