February 13, 2015

Apple Script to copy a file repeatedly

Open Apple Script Editor and add the following script and hit run button.

set theFile to "Macintosh HD:Users:maheeka:original_file:test.xml"
set theDestinationFolder to "Macintosh HD:Users:maheeka:test_des"

repeat 10 times
tell application "Finder"
duplicate theFile to theDestinationFolder with replacing
end tell
delay 2
end repeat

Note :
  • Always use an alias for the file location
  • File path should be separated with : and not /

No comments:

Post a Comment