Often when managing collections of files in the OS X Finder, you may find that giving the files unique or patterned names may help in your organization. For instance, if you have a set of image files it may help to quickly append a date or sequential number to the file name; to do so manually might take a while.
At other times, you might wish to quickly append a time stamp or other similar attribute to a file name without having to manually edit the name. As an example of this, if you use the OS X compress feature (available when right-clicking a selection of files) to create a ZIP archive, the compressed file will simply be called "archive.zip," and be easy to confuse with other archives you might be managing; however, you can overcome this by being able to quickly change the archive name to "Archive-DATE.zip."
In OS X you can set up a routine to batch-rename files using Apple's Automator program, where you can make a service plug-in that will offer you options to change names to collecitons of files.
- Create a new Service workflow
Open Automator and create a new workflow file (press Command-N or choose New from the File menu). Then choose Service from the window of available workflow types (this option will look like a gear).
- Adjust Service inputs
Services act on items you pass to the workflow, which can be images, sound files, or even selected text. In this instances we want to be able to modify all files and folders, so be sure to choose "files or folders" from the first drop-down menu at the top of the workflow, and then choose Finder from the second menu. This second option will ensure the workflow only acts on files and folders from the Finder, and not be available in other applications. If needed you can set the workflow to only act on PDFs or other document types, depending on your needs.
- Add a file rename action
The next step is to add an action that will rename any files passed to the workflow, so drag the Rename Finder Items option from the action library (to the left of the window, under the Files & Folders category) to the workflow window. When you do this, Automator will issue a warning that this action will alter existing files, and provide you with an option to add an action to first copy the files instead of altering them. At this point click Don't Add, and you will see the rename action be available in the workflow with a number of options.
- Adjust the naming scheme
Now you can adjust the new action according to your preferences. Using the menu at the top-left of the action, you can choose to add a date or time to the name (the default action), or append text, change the case of the name, add sequential numbering, replace text, or simply rename a single item. At the bottom of the workflow you will see an example of the name that your settings will produce.
- Add more file renaming actions
A single instance of a file-naming action will only change one aspect of the file name, so you can make multiple modifications by adding more renaming actions sequentially. For instance, if you would like to append both the date and time to a file name, you will need two renaming actions. The first will append the date, and the second one will append the time.
- Save the workflow
When your workflow is complete, saving it will automatically place it in the /username/Library/Services/ folder, which will make it available via the OS X contextual menu. Now when you go to the Finder, you can select a group of files or folders, and then right-click them and select your workflow from the Services submenu of the contextual menu.
Using Automator in this way you can create one or several renaming services for your files, but you can also use one of several renaming tools that are available for OS X: