Batch Rename Your Files

Let’s dive into one of my all-time favorite Finder tips – an Automator service that lets you quickly replace text within filenames on the fly! If you’ve not yet begun using the Automator app, this is a great first project (or scroll down to download the Automator service for a quick install).

Why Use It

As a packaging artist, most of my projects include a minimum of 20 files. I employ varying hacks and tricks to generate those files quickly, but the result is usually a series of files that require some minor tweaking to their end filenames.

Alternatively, if you’re not swimming in your work files every day, you might find a need to quickly replace the filename of several recently imported photos (think of that horrific, “IMG_”), or you might want to quickly add the date to some scanned files.

Built-In Rename Vs. Homemade Automator Service

Since OS Yosemite (OS X.10), Apple has included a built-in Finder feature that allows you to quickly rename selected files and folders from the secondary menu; however, this feature can also be slightly limiting in comparison to an Automator approach. With the built-in Rename, you’re unable to specify a spacer between the date and original filename, and you’re also unable able to specify the format of the date itself (think MONTH/DAY/YEAR vs. YEAR/MONTH/DAY) – it also automatically includes the hours and seconds, which I find really annoying. Really annoying.

From this perspective, utilizing an Automator approach is beneficial, as you’re able to specify exactly how you would like the date/time to appear – right down to the date’s separator (“/“, ““, or none), as well as the spacer between the date and original filename (SPACE, “/“, ““, “_“, etc.). We’ll start with how to build your own Automator service, but the steps for using the Built-In Rename can be found directly below those instructions.

Creating Your Own Rename Automator Service

Follow the steps below to create your own batch rename Automator service, or scroll down to download the Automator script*:

  1. Open the Automator app (shortcut: CMND+SPACE+Automator+ENTER), and select Service as the document type from the menu prompt.
  2. Within the new Automator window, specify “files or folders” from the top drop down menu – this tells your Mac to enable to the service whenever a file or folder is selected. Narrow the criteria by selecting “Finder” from the second top drop down menu, so that the service is only enabled when selecting a file/folder within a Finder window.
  3. Now add the following actions from the menu options in the left sidebar (or use the search bar to quickly navigate available actions):
    1. Add Get Selected Finder Items, this tells your Mac to limit any actions following to only the selected file(s)/folder(s).
    2. Add Rename Finder Items, then specify how you would like to rename the selected documents via the newly prompted drop down menu – available options include Add Date or Time, Add Text, Change Case, Make Sequential, Replace Text, and Name Single Item. For the purposes of this Automator service, select Replace Text.
    3. From the second drop down menu, specify where you would like Finder to search and replace text within the selected file(s)/folder(s) filenames – the full name (filename and the file extension), basename only (exclude the file extension), or extension only. I prefer to edit the basename only, simply because editing a file’s extension by name only does not really convert the file from one format to another.
    4. If you prefer to search and replace text regardless of uppercase or lowercase letters, check the box next to Ignore Case.
    5. Now for the most important step IMHO – select Options at the bottom of the action’s window, and check the box next to the left of Show this action when the workflow runs. This last step ensures that each time you run your new service, a window will prompt where you can change the above settings every time you enable the service – so if you want to Change Case or Add Date or Time at some point, you have the option to without creating a new service! (I hope you’re as excited about this time saved as I am.)
    6. Save your newly created service (shortcut: CMND+S) with a name that will stand out to you from within the secondary menu options – I’ve saved mine as “Replace Text”, but you might prefer “Rename Files” or simply “Edit File Names”.
    7. To run your service, head to a Finder window and select the file(s)/folder(s) you want to rename. Prompt the secondary menu with a right click (shortcut: CTRL+select), and hover over Services near the bottom of the menu, then simply select your service and complete the options from within the newly prompted menu.

Using the Built-In Rename

  1. Select the files you would like to edit.
  2. Right click (CTRL + click).
  3. Select Rename X Items….
  4. From the newly prompted window, define how you would like to edit the filenames:
    1. Replace Text: Find special characters or a specific phrase within the filenames and replace with something else of your choosing.
    2. Add Text: Add special characters or a specific phrase either before or after the filename.
    3. Format: Reformat the filename by adding an index number, specifying a counter, or adding the date and time either before or after the filename.

While it’s nice to see that Apple has included a batch file rename service out of the box, it’s not quite as powerful as an Automator approach. It makes for quick work, but you may find yourself having to edit and re-edit until your files are named the way you like, and for that reason I recommend spending a few minutes building your own service in Automator to save yourself a few seconds in the future.

  • * If you download the Automator service, move the file to: ~/Library/Services/

Keep Your Desktop Clean (with Hazel or Automator)

Like so many other Mac users, I am guilty of saving files to the Desktop. The shortcut (CMND+D) is so much easier than selecting a folder from the sidebar! Which saves me so much time – ALL the time – time I’m able to use to go back and organize the files sitting on the Desktop.

Except, not so much. The reality is that by the time I get around to organizing those files, I’ve mostly forgotten their original purpose. And I hope you weren’t expecting me to keep a list of any graphics files that might link to Desktop files, because there’s no way I’m going back to correct those links until it’s an issue.

Er… I think you can see the issue with saving files to the Desktop. Whether you believe files sitting on the Desktop really do slow your computer down, or you’re also finding that the Desktop is a less than ideal Inbox, automation is here to help!


Screen Shot 2016-04-09 at 10.25.51 PM

Hazel is an automation app that sits in your Mac’s System Preferences. The beauty of this app is that it simplifies the sometimes daunting power of Automator, and it does this by allowing you to create a series of rules that it applies to folders you instruct it to monitor.

Keeping your Desktop clean with Hazel is as simple as five steps:

  1. Add the Desktop folder to Hazel.
  2. Add a new rule to the Desktop folder.
  3. Set the first criteria drop down to Any File, since you want all files on the Desktop to be moved.
  4. Under Do the following… set the action drop down menu to Move, then select the folder you want all Desktop files moved to from within the newly prompted drop down menu.
  5. Select Ok.

Conversely, there may actually be specific files that you want to always stay on the Desktop, such as alias folders. Protecting these files is as easy as ensuring that the very top drop down menu in Hazel is set to All, then add a new criteria rule that specifies Kind with the condition is not and the file type Alias (see figure above for reference). This additional step simply tells Hazel to look for any file that is not an alias file, and that file is the one to which the action will apply.

For my purposes, I have created an Inbox folder inside my user folder, and that is where Hazel moves all my Desktop files. Hazel then monitors the Inbox for additional rules, such as moving all image files into a specific folder, or grouping similarly named PDFs into particular folders, etc.

I’ll share what my Inbox folder’s rules look like in the future, but for now feel free to download my Desktop’s Hazel rule for convenience.



The same effect can also be reached by utilizing Automator’s built in Folder Action capabilities, though it requires a few more steps than Hazel.

Follow the steps below to replicate the Hazel rule created above, or scroll down to download the Automator script*:

  1. Open the Automator app (shortcut: CMND+SPACE+Automator+Enter), and select New Document from the menu prompt.
  2. Select Folder Action as your new document type.
  3. Within the new Automator window, specify Desktop from the top drop down menu – this tells your Mac which folder to monitor for file/folder changes. Now add the following actions from the menu options in the left sidebar (use the search bar to quickly navigate action options):
    1. Add Find Finder Items, then specify the Desktop folder from the Search dropdown menu. Here, you can specify the types of files you want Automator to move – or not move. I instructed Automator to find all files except alias files/folders.
    2. Add Move Finder Items, then specify the new folder you wish to house files saved to the Desktop folder from the To dropdown menu.
    3. Save your script (shortcut: CMND+S).**
  4. Technically we should be able to stop here, since our very first step instructed Automator to monitor the Desktop folder; however, Automator does not always perform properly during a script’s first run.
    1. To ensure that our script does work, direct your Finder window to the Desktop folder.
    2. Enable the secondary menu (shortcut: CTRL+select) and hover over the Services option.
    3. Select Folder Actions Setup….
  5. Within the newly prompted Folder Actions Setup window, follow these final steps to ensure your new Automator script runs indefinitely:
    1. Ensure that Enable Folder Actions is checked at the top.
    2. Select the left + button to add the Desktop folder to the left area – telling your Mac to monitor the Desktop folder.
    3. Finally, select the right + button to add your newly created Automator script to the right area – telling your Mac to apply the script to your Desktop folder.


  • * If you download the Automator script, move the script to the path below and then complete all steps beginning from Step 4.
  • ** You can find the saved Automator script at: ~/Library/Workflows/Applications/Folder Actions/

Additional Reading

Favorite OS X Apps

As many of my friends know, I am not afraid to try new apps for my Mac and iOS devices – so long as the price is under $20! I spend a lot of time hunting these apps down and then learning how to best use them, so I’m excited to share eight of my current favorite OS X apps in the hopes that they might also help others.

I use these apps every day, and I’m not quite sure how I ever survived without them. If you’re considering downloading (or purchasing) an app, but find yourself on the fence, feel free to reach out to me to ask questions:


App - Hazel

Hazel from Noodlesoft (Automated Organization for Your Mac):

Hazel is a friendlier version of Apple’s built in app, Automator, both of which allow you to automate frequent or repetitive actions, like moving any file saved to your Desktop, or organizing your Downloads folder based on a series of rules. What Hazel does well is removing some of the confusion and strain that Automator can be for users, and I’m excited to share some of my favorite Hazel rules with you in future posts!


App - Caffeine

Caffeine from Lighthead (Don’t Let Your Mac Fall Asleep):

Perhaps more a utility than an app, I couldn’t resist showcasing Caffeine given my preference for all things coffee-adjacent. Caffeine takes the form of an empty coffee cup in your Mac’s menu bar, just select the cup to fill it up – keeping your Mac awake indefinitely or for a period of time you specify at the initial startup.


App - Alfred

Alfred from Running with Crayons, Ltd. (A Keyboard-Driven Productivity App):

Many think of Alfred as a Finder alternative, but I haven’t stopped using Finder since installing Alfred – in fact I use them in very different ways. Using a series of keyboard controls that its user defines, Alfred prompts a variety of actions for specific file formats (though Alfred 2 packed an extra powerful punch with its introduction of workflows). Like Hazel, Alfred is as powerful as its user is creative, so don’t be afraid to grab your favorite cup of coffee and explore the app’s abilities.


App - MindNode

MindNode from IdeasOnCanvas (Makes Mind Mapping Easy):

In my profession, I often find myself working with theoretical ideas where visual representation is a critical difference between success and failure. After making do with a few mind mapping web apps, I started searching for something more powerful (and with more visual control) two years ago, and I stumbled across MindNode. I haven’t looked back since, and the app boasts iOS counterparts as a bonus!


App - Automator

Automator from Apple (Automate Frequent Tasks):

While I mentioned above that Hazel is a friendly alternative to Automator, this app is still not replaceable in that it allows you to build new apps, bring function to scripts, and add actions to the “Services” section of the secondary click menu.

I currently use Automator to quickly archive selected files, or to combine selected PDFs into one large PDF. I’m excited to share these workflows with you in the future, but in the meantime head over to MacOSXAutomation to learn more!

6App - AppCleaner

AppCleaner from FreeMacSoft (Thoroughly Uninstall Unwanted Apps):

As a fan of keeping my Mac as clean and speedy as possible, I am a big believer in removing all unnecessary files. There are also times when it becomes necessary to start fresh with an app, and the cache files that remain after moving the app to the trash bin just don’t allow for a clean start, which can cause a multitude of unwanted headaches and errors. More dreaded are the times that native apps, such as Safari or Photos, experience corrupt cache files, but finding those cache files is sometimes difficult.

Enter AppCleaner, which searches your Mac’s drive to find all cache files related to the app you wish to remove. Just drag and drop your app into the AppCleaner and then hit the Remove button with an unfettered mind!


App - Knock

Knock from Knock Software (Knock to Unlock):

A combination of OS X and iOS, Knock communicates your Mac’s admin password using an iPhone app when two things occur: 1) your Mac prompts a security window; and 2) and you knock on your phone. As someone that relies on a series of extended passwords combining letters, numbers, and symbols, Knock is a pretty nice convenience whenever I open up my Macbook.

Unfortunately, Knock currently only supports one device at a time, so you might need to decide whether that convenience is better at home or in the office, or between your desktop or laptop computers.


App - MailButler

MailButler from Feingeist (Your Personal Assistant for Apple Mail):

Though still in the trial period, I have enjoyed MailButler so much that I couldn’t resist including it in my top OS X apps.

Apple users tend to fall in two categories of practice when it comes to native apps, like Mail: 1) never touch them, but always hate them; or 2) use them forever with love. I fall in the latter, as I frequently argue that native apps can do what you want them to do with a little elbow grease – and some time to actually learn the apps. Plus, who wants third-party apps taking up drive space?

Unfortunately, while Apple has made significant improvements to Calendar, Notes, and Reminders, Mail has become less powerful over time (though new markup tools have been a nice addition). Mail still lacks many of the abilities Outlook offers out of the box, like undo Send, request read receipts, or Send scheduling – until MailButler.

OS X Panther or Tiger users may remember that Mail used to allow for third-party extensions and utilities that made these features possible, but these extensions became more extinct with each new OS update. MailButler appears to be the joining of these antiquated extensions – literally – brining them new life and support to your Mac. Unfortunately, the app relies on a monthly subscription fee that feels wrong for an app that operates more like a utility.

I haven’t been forced to commit to a monthly subscription yet, though it will be a tough decision when it comes, as I am seriously enjoying the features MailButler offers both my home and work Inbox.