Mac - Batch Rename Files

Thursday, August 8, 2013


Apple Mac OSX 10.6
Automator
How to Batch Rename Files
With a Right-Mouse-Click

Quick Answer:
Here's the file you want to download:
http://automatorworld.com/downloads/batch-rename.zip

Drop it into your Services Folder [user/Library/Services]
Start using it by selecting the files you want to rename, then
1. Right-Clicking (or control-click) and choosing Services > Batch Rename.
2. or in the Finder Drop-Menu, choose Services > Batch Rename.

You can edit the file above in Automator, or create your own such as I did.  I made two Batch Rename services.  One for renaming photos and one for renaming music.


Explanation:
Mac is able to do such things with the built in Automator.  It Automates tasks - usually tasks that people do repetitively can be Automated to be performed with the click of one button.  In this case, I want to rename many files all at once.  Why would one need to rename so many files at once?  Well, for me, I have a couple reasons:

1.  I just downloaded 200 photos from my digital camera over to my computer.  They are all named such as this:  DSC0009876.jpg, DSC0009877.jpg...

2. I just copied a whole bunch of random photos of sunflowers off of the net for a study on sunflowers and they all have various names such as:  sunflower_007.jpg, sunny-day-flower.jpg, garden-009.jpg...

But, I want them to look more like this:
Summer Holiday - Banff National Park - 001 - (2010-08-30).jpg
Summer Holiday - Banff National Park - 002 - (2010-08-31).jpg
Summer Holiday - Banff National Park - 003 - (2010-09-01).jpg
Summer Holiday - Banff National Park - 004 - (2010-09-02).jpg

or

sunflower01.jpg
sunflower02.jpg
sunflower03.jpg
Wouldn't it be nice to be able to just highlight the files, right-click, choose Batch Rename Photos, select a few parameters, and presto?  Sure, if you want to add some details of the file, you'll have to do that manually, but that's easy, such as this:

Summer Holiday - Banff National Park - 003 - Swimming In Lake Louise (2010-09-01).jpg

An automated task in Automator is called a "Workflow".  I know I know, so much bloody jargon with computers.  Stay with me.  There are different types of Workflows you can create:

  • Workflow - just an automated task that will open Automator, and you run it with Automator
  • Workflow Application - will create a separate application that will run your automated task, that way you can have it sitting in your app dock or on your desktop for frequent use.
  • Workflow Service - will add your automated task you created with Automator to the Services Folder [user/Library/Services] and this will make it available to you as a right-click-choice or in your Finder Window Drop-Menu under Finder > File > Services.
....and there are a few others too, but you get the idea.

Making a Workflow automated task is as simple as dragging the actions from the Actions Library on the left over to your blank workspace on the right.

Just download the file (at the top of this post), open it (will open automatically in Automator), and have a look.  Each Action is represented as a box.  Really simple and easy to understand.  You can change it and fool around with it to see how it works (and that I haven't inserted any unwanted Automated Tasks in there such as Format Disk) and customize it for yourself, if need be, because that's exactly what I did to create this file - I fooled around with someone else's to suit my own needs.


Make your own:

Steps:
  1. Open Automator
  2. Open a New file
  3. Choose a template for your workflow: choose "Service"
  4. Drag Actions from the left pane to the right where is says "drag actions or files here"
  5. Actions > Files & Folders > Get Folder Contents
  6. Drag the "Get Folder Contents over to the right pane
  7. Then do the same for: Get Specified Finder Items, Sort Finder Items, Make Finder Item Names Sequential, Add Text to Finder Item Names, Add Text To Finder Item Names, Add Date or Time to Finder Item Names, Add Text to Finder Item Names
  8. All in that order.
  9. At the very top choose Services receives selected "files and folders" in "Finder"
  10. this is what it should look like:
(Click for Larger Image)
(Click for Larger Image)

    10. Now go to each window and format everything the way you see it in the above picture.
    11. Once you are done, save it as "Batch Rename Photos.workflow"
    12.  Move or copy the file into your [home] > Library > Services folder.
    13.  And that's it.  You may have to restart your computer or restart finder (force quit) and now you can select a number of photo files you have, right-click > Services > Batch Rename Photos.


Batch Rename Music Files:

Okay, now that you did that, it's really easy to make one for renaming music files:


(Click for Larger Image)


No comments:

previous home next
COPYRIGHT © SCOCASSO