Here I correct a typo in Shane’s proposal and add some instructions to sort as the Finder does.
(*
Beginning of the original code
*)
if theResult as boolean is false then
set end of failures to (item i of sourceNames) as text # WAS theFailures
end if
end if
end repeat
-- show the results
set {saveTID, AppleScript's text item delimiters} to {AppleScript's text item delimiters, {", "}}
set dupeString to (my sortAList:dupes) as text
set failureString to (my sortAList:failures) as text
set AppleScript's text item delimiters to saveTID
display dialog "Copying finished with:" & linefeed & "Failures: " & failureString & linefeed & linefeed & "Duplicates: " & dupeString
on sortAList:theList
set theArray to current application's NSArray's arrayWithArray:theList
set theArray to theArray's sortedArrayUsingSelector:"localizedStandardCompare:"
return theArray as list
end sortAList:
With the typo corrected, the original returned:
"Copying finished with:
Failures: File 1, File 11, File 16, File 21, File 26, File 31, File 36, File 41, File 46, File 51, File 56, File 6, File 61, File 66, File 71, File 76, File 81, File 86, File 91, File 96
the edited version return:
“Copying finished with:
Failures: File 1, File 6, File 11, File 16, File 21, File 26, File 31, File 36, File 41, File 46, File 51, File 56, File 61, File 66, File 71, File 76, File 81, File 86, File 91, File 96”
Yvan KOENIG running High Sierra 10.13.6 in French (VALLAURIS, France) vendredi 25 octobre 2019 18:17:59