This workflow will only work with Alfred 3 and newer.
This workflow lets you rename multiple files at once via a file action. Therefore the workflow asks you for a matching pattern first and for a replace pattern after that. Alfred provides you with some useful predefined options. After defining both patterns you'll see a preview of the renaming result.
Step by Step
- You are ask to enter or choose a regular expression which should match parts of the input file. File endings are not renamed so your regex must not match a file name with its extension but only the name itself.
- You can use a normal python regex.
- You are ask to enter or choose a rename pattern (also a regular expression). Here you have the following options:
- $0 matches the full input, i.e. if your file is named 'foo.jpg' $0 gives you 'foo'.
- $1 to $9 contain the regex matching groups, you have defined previously.
- {n} contains a serial number which starts at 1.
- {d} contains the current date in the format 'YYYY-MM-DD'.
- You can add the following options in front of the normal pattern followed by a /:
- c to capitalize every word
- r(<from>,<to>) to replace every occurrence of <from> with <to>
- Multiple options can be divided by / again.
- After pressing enter again, Alfred shows you a list which gives you a preview of how the renaming will look.
- Pressing enter again will rename all files according to your expressions.