How to rename files by adding them to a folder
Mac Tip #438, 26 May 2010
Would you like your Mac to automatically make changes to files when you add those files to a folder? Folder Actions is what you need — available through Automator. Here’s how to make a Folder Action to rename files.
An attachment name problem
A client’s webmail added .html to the end of all attachment names — even MS Word files or PDFs. She was unable to open any attachments until she manually renamed the files. This wasted time and was annoying.
Rename files automatically
I’ve written several Tips over the years about how to manually rename files on a Mac. The articles are listed at the end of this Tip. All those methods require you to actually do something though.
Make a Folder Action with Automator in Snow Leopard.
How about if the file names changed by themselves as they arrived in a folder? That’s what a Folder Action can do for you.
A Folder Action is one or more actions triggered by adding a file to a folder. There are many possibilities including renaming, zipping, moving to another folder, resizing images, and so on.
How to make a Folder Action
In brief:
- Open Automator in Snow Leopard and select
Folder Actionas what you want to create. - Specify the Folder the Actions will be attached to.
- Add Actions to the Workflow.
- Save the Workflow.
- Add files to the relevant folder.
Set the correct options for renaming your files.
Step by Step instructions
- Open Automator — it’s in the Applications folder. A window appears where you must choose a type of Automator Workflow.
- Choose
Folder Actionfor the Automator workflow type. - Create a new folder inside your Downloads folder — or anywhere on your Mac that you need it.
- In Automator choose that folder for the Folder Action to apply to — from the drop-down menu in the top right corner of the window.
- In Automator click on
Files and Foldersin the Library list — This just filters down the available actions in the list to the right of it. - Select
Rename Finder Itemsin the list of actions and drag it into the work area on the right. An alert appears asking about duplicating the files. ChooseDon't Add: you don’t need to keep backup copies of these files — you’re only changing the name. TheRename Finder Itemsaction appears, with the wrong (default) settings. - Change the settings in the Rename Finder Items action:
- Choose
Replace Textfrom the drop-down menu that currently saysAdd Date and Time. - In the
Findbox put the text you want to replace. In my example that is.html. - Leave the drop-down menu that says
Full Nameas it is. You will find.htmlin theFull Nameof the file. - Leave the
Replacetext box blank. You will find.htmland replace it with nothing.
- Choose
- Save the Automator Folder Action — File menu: Save.
- Give the Folder Action a name — the actual name doesn’t matter — and click Save. You can’t choose where to save this Folder Action — the Mac just puts it in the right place.
- Test the Folder Action: put some files in your special folder. The
.htmlextension should just magically disappear.
Download a PDF
The steps are all detailed with a large screenshot for each step in How to rename files by adding them to a folder (1.7Mb PDF). Download for free. Donations welcome — use the button at the top of this Tip.
How to rename files on a Mac
Tell us in the Comments at the website how you use Folder Actions
See more from: Automator,Finder,Snow Leopard
It's great to see you visiting again! Have you tried the free MacTips updates via RSS or email, MacTips on Twitter and our YouTube channel? There may be more Tips on this topic. We'd love your Comments too.




* 2 comments… read them below and tell us what you think.
Hey – great tip – I hadn’t heard about folder actions till the weekend when I set up a folder action to auto-add documents to evernote. This is a great other use for them. (And one to remember next time i need to batch change some file extensions!)
Thanks Jo. Good to know this was useful.
I want to explore other Folder Actions too – there were opportunities to resize images, for example, and some very handy possibilities of adding dates and time.
These Folder Actions are just magic!
Care to explain how the Evernote Action went?
Add your Comment