Aquí hay una solución de AppleScript que es bastante eficiente. Puede guardar este código en script editor.app como una aplicación.
set newName to 0
set theFolder to (choose folder with prompt "Choose Folder" with invisibles)
tell application "Finder"
set theFolders to folders of theFolder
set sortedFolders to sort theFolders by name
repeat with i from 1 to count of sortedFolders
set newName to newName + 1
set thisItem to item i of sortedFolders
set name of thisItem to newName
end repeat
end tell
Siprefierequelosnombresdelascarpetasdeunsolodígitoaparezcancomodosdígitos(01,02,03,etc.),utiliceestasiguienteversióndelscript
setnewNameto0settheFolderto(choosefolderwithprompt"Choose Folder" with invisibles)
tell application "Finder"
set theFolders to folders of theFolder
set sortedFolders to sort theFolders by name
repeat with i from 1 to count of sortedFolders
set newName to newName + 1
set thisItem to item i of sortedFolders
if newName is less than 10 then
set name of thisItem to 0 & newName as string
else
set name of thisItem to newName
end if
end repeat
end tell
El siguiente código AppleScript cambiará el nombre de los archivos en la carpeta elegida, en lugar de cambiar el nombre de las carpetas.
set newName to 0
set theFolder to (choose folder with prompt "Choose Folder" with invisibles)
tell application "Finder"
set theFiles to files of theFolder
set sortedFiles to sort theFiles by name
repeat with i from 1 to count of sortedFiles
set newName to newName + 1
set thisItem to item i of sortedFiles
set nameExtension to name extension of thisItem
if newName is less than 10 then
set name of thisItem to 0 & newName & "." & nameExtension as string
else
set name of thisItem to newName & "." & nameExtension as string
end if
end repeat
end tell