Randomize Filenames in a Folder
I would like to randomly sort all of the photos in a specific folder without duplicating them. The original post for this question is here: https://discussions.apple.com/thread/1135603 (2007)
Here is the script I used (I have never used AppleScript before). It was successful in randomly sorting the images but it would make duplicates of some and others would not be included at all. What could I do to fix this problem?
tell application "Finder"
set destFolder to (make new folder at desktop with properties {name:"RandomSort"})
set sourceFolder to (choose folder with prompt "Please select the source images folder")
set numFiles to (number of files of folder sourceFolder)
repeat with i from 1 to numFiles
set newFile to (duplicate some file of folder sourceFolder to destFolder)
set name of newFile to (i & ".JPEG" as text)
end repeat
end tell
It all ran well other than duplicating some images and not including others.
MacBook Air 13″, 11.2