Some time ago – when macOS Finder didn’t have the feature to batch rename files – I created an AppleScript for this job. The script is hosted on Gist and receives much appreciation by people, so I thought I’ll share it here as well.
How the script for batch renaming files works
- Launch the Script and it will ask to selected the desired files
- As a second step, the user is prompted to specify the new file name
- That’s it: the script renames the chosen files with the new file name and a sequential index number
How about drag’n’drop support for renaming files?
Thanks to the great feedback in the Gist, I added a second variation of the AppleScript that allows creating a Droppable Application – now all you need to do is drag’n’dropping the files on it, in order to start the batch file rename process.
Here’s the code to batch rename files using AppleScript
Simply copy-paste the code snippet into Script Editor in macOS, save it as any type of application – and you’re good to go.
There are 2 different code snippets as of now
A GUI version
files & file name must be selected manually by the user
A draggable version
files can be drag’n’dropped onto the script’s app icon, file name must still be entered manually by the user
https://gist.github.com/oliveratgithub/b9030365c9ae483984ea
Do you have any suggestions? Feel free to fork the snippets on Gist or add a comment.