tell application "Finder"
activate
display alert "This script calculates how long it takes to make 500 folders and then rename them on your current operating system"
set finderVersion to (the version)
try
make new folder at desktop with properties {name:"TestFolder4Rename"}
end try
set n to 1
set time_stamp_one to (current date)
-- Make 500 folders with the same name and a number increment
repeat 500 times
set rename_plus_num to ("DummyFolder" & n) as string
make new folder at folder "TestFolder4Rename" with properties {name:rename_plus_num}
set n to n + 1
end repeat
-- Calculate how much time it took in seconds
set time_stamp_two to (current date)
set time_difference to (time_stamp_two - time_stamp_one)
set time_dif_string to time_difference as string
activate
display alert "---------- OS " & finderVersion & " ----------" & return & return & "Creating 500 folders took approximately " & time_dif_string & " seconds to complete. Now let's see how long it takes to simply change their names…"
set time_stamp_one to (current date)
-- Rename 500 folders with a number increment
set folder_items to displayed name of every item in folder "TestFolder4Rename"
set n to n + 1
repeat with curFile in folder_items
set rename_plus_num to ("Changed Name" & n) as string
set the name of item curFile in folder "TestFolder4Rename" to rename_plus_num
set n to n + 1
end repeat
-- Calculate how much time it took in seconds
set time_stamp_two to (current date)
set time_difference to (time_stamp_two - time_stamp_one)
set time_dif_string to time_difference as string
activate
display alert "---------- OS " & finderVersion & " ----------" & return & return & "Renaming 500 folders took approximately " & time_dif_string & " seconds to complete."
end tell