

The reqular expression that I wrote (e.g. I have a bunch of files and folders that contain some thing like the following. If the filename conforms to the regular expression match, then the capture group (remaining filename) is in the match variable and the file is renamed.

The second Automator action will collect all of the files in the selected folder and pass them into the Run Shell Script action, where the for loop processes them individually. It will accept a single folder choice containing the files you want. You then double-click the Automator application on your Desktop. It will have a workflow that looks like this: Save the Automator application to your Desktop with a useful name (e.g remove9.app).Copy/paste the script that I posted earlier into this Run Shell Script window.Name Mangler also offers an Advanced option that lets you define your own renaming rules, combining the standard options and letting you. Click on the black border near the bottom of the action, and then grab the blue border and drag downward to enlarge the window. Name Mangler gives you a clean, intuitive interface for numbering sequentially, finding and replacing, changing case, setting extensions, adding prefixes and suffixes, and removing and inserting characters.Select all of the content in this window and remove it.Note: The screen capture of the Run Shell Script action below, shows /bin/bash, and it should have shown /bin/zsh for the shell selection.Select library Utilities -> drag Run Shell Script and drop below the preceding actions.If you have multiple sub-folders within the target folder, then check Repeat for each subfolder found, otherwise leave that unchecked. Select library Files and Folders -> drag Get Folder Contents action, and drop below the previous action.Select library Files and Folders -> drag the Ask for Finder Items action to the large, right workflow window and drop it.On the left will be libraries that contain actions. Then click New Document, and that will lead to another panel, where you want to select Application as the type of Automator document, and then click choose. It will present a chooser, and you select Desktop as the location. From your /Applications folder, double-click Automator (robot icon).
