← XeFM crftwr/xefm on GitHub · craftware

Batch Rename Feature

Overview

The batch rename feature allows you to rename multiple files at once using regex patterns and destination templates with special macros.

How to Use

  1. Select Multiple Files: Use the space bar to select multiple files in the file manager
  2. Trigger Batch Rename: Press ‘R’ key when multiple files are selected
  3. Enter Patterns: The batch rename dialog will appear with two input fields:
    • Regex Pattern: A regular expression to match parts of the original filenames
    • Destination Pattern: A template for the new filenames using special macros

Special Macros

The destination pattern supports the following macros:

Examples

Example 1: Add Prefix

Example 2: Change Extension

Example 3: Add Sequential Numbers

Example 4: Extract and Reorder Parts

Dialog Controls

Preview

The dialog shows a real-time preview of the rename operation:

Safety Features

Notes

Accented and Japanese names

Some characters can be written two ways that look identical on screen — が as one character, or as か plus a voiced-sound mark. Files written the second way come from HFS+ disks, network shares, archives, and from Finder itself.

XeFM treats the two spellings as the same text, so a search pattern typed at an IME finds a file however it happens to be stored, and two files whose new names differ only in spelling are reported as a conflict instead of one silently replacing the other.

A renamed file is written back in the single-character spelling. Finder uses the other one, so on macOS a name XeFM renames may end up spelled differently from the same name renamed in Finder. The file is the same file either way and both spellings open it; the difference matters only on disks and cloud storage that compare names byte for byte, which is why XeFM keeps one spelling everywhere. Files the rename does not touch are left exactly as they are.