¿Hay alguna manera de reemplazar por lotes los nombres de las carpetas actuales con números crecientes? La función integrada "Cambiar el nombre de los elementos del buscador" solo le permite reemplazar en el tipo de "Buscar y reemplazar texto". No todos los nombres de mis carpetas actuales tienen caracteres comunes. Estoy usando Mojave, por cierto.
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
Si prefiere que los nombres de las carpetas de un solo dígito aparezcan como dos dígitos (01,02,03, etc.), use la siguiente versión del script en su lugar
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
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
Seleccione todas las carpetas que desea cambiar de nombre, haga clic con el botón derecho en ellas y seleccione "Renombrar [número] elementos..."
Cuando utiliza la función "Renombrar elementos del buscador", debe cambiarla de "Reemplazar texto" a " Formato " en el menú desplegable:
Ahora puedes renombrarlo como quieras:
usuario1787331