Bien, un enfoque totalmente diferente.
Utilice sólo AppleScript.
Paso 1: Crear carpetas (de entrada y de salida)
Paso 2: Crear script
on adding folder items to theAttachedFolder after receiving theNewItems
set text item delimiters to "."
set outputFolder to POSIX file "/Users/YOURUSERNAME/Desktop/random/output/"
tell application "Finder"
set all_files to every item of theNewItems as list
--now we start looping through all selected files. 'index' is our counter that we initially set to 1 and then count up with every file.
repeat with index from 1 to the count of all_files
set x to ""
repeat 10 times
set x to x & some item of "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
end repeat
set new_name to x
--using our index, we select the appropriate file from our list
set this_file to item index of all_files
set file_name_count to text items of (get name of this_file)
--lets check if the current file from our list (based on index-number) has even any file-extension
if number of file_name_count is 1 then
--file_name-count = 1 means, we extracted only 1 text-string from the full file name. So there is no file-extension present.
set file_extension to ""
else
--yup, we are currently processing a file that has a file-extension
--we have to re-add the original file-extension after changing the name of the file!
set file_extension to "." & item -1 of file_name_count
end if
--let's rename our file and add the file-extension to it
set dupeFile to duplicate this_file to outputFolder
delete this_file
set the name of dupeFile to new_name & file_extension as string
end repeat
end tell
end adding folder items to
Paso 3: Guardar script en ~/Library//Carpeta Acción /
Paso 4: Haga clic con el botón derecho del ratón en la carpeta de entrada > Servicios > Configuración de la acción de la carpeta
Paso 5: Conectar script a la carpeta.
En la parte izquierda añades tu carpeta de entrada, haz clic en la carpeta en la lista de la izquierda. En la lista de la derecha eliges tu script</strkeep><strkeep>.
Paso 6: Añadir un grupo de archivos en la carpeta de entrada. Obtienen nombres aleatorios en la carpeta de salida y se eliminan de la carpeta de entrada.
¡No olvides cambiar el valor de outputFolder dentro del script!
0 votos
¿Los archivos renombrados deben incluir su extensión original? En otras palabras, ¿es
someFilename.jpg
que ha pasado a llamarserandomFilename.jpg
sólo pararandomFilename
?