Rename Document Action

The Rename document Action allows you to automatically rename incoming files. This Action changes the names of processed documents. By default, it's set to {*SrcFileName} – the source file's name. The Rename document Action is typically used to:

Note: this Action must be used in combination with other ones. Don't forget to add a finalizing Action — such as Convert to Image or Convert to PDF — for the process to take effect.

“Rename document” Action in FolderMill allows to set a new filename using built-in macros

Using macros to create a new file name

Besides plain text, you can utilize built-in macros to create your own naming pattern. These macros allow you to check various file properties — such as EXIF data, filename metadata, and date/time information — and apply them to the output filename.

You can use various macros (by using the Macro button) to check file properties such as file's name and extension, EXIF metadata, date/time, and other information to apply them to the output filename.

For example, if your source files are email message files (.msg, .eml files), you can set a naming pattern using data retrieved from them: Delivery timestamp, To address, From address, Subject, and more.

Rename document automatically using email metadata

Description of all available macros

Macro/Group of macrosMacroDescription
Regular expression of source file name{*srcfilename("^(\d+)")}, {*srcfilename("(\d+)$")} and othersVarious parts of the source file's name:
  • Take digits from the beginning
  • Take digits from the end
  • Take any first symbols after dash
  • Cut "quick brown fox" from filename
  • Cut one character
  • Cut all apostrophes

Note: Regular expressions starting with "Take" will add information to the output filename, while those starting with "Cut" will remove information. For example, Cut one character removes the first symbol from the filename.

Filename
Source file name{*srcfilename}File name (without extension).
Example: Document_A
Source file extension{*srcfileext}File extension.
Example: docx
Source file subfolder, level 1{*srcfilesubfolder(1)}The name of the first subfolder nested in the Hot Folder.

Example:
C:\Work\Hot_Folder\level1\level2\level3 
Source file subfolder, level 2{*srcfilesubfolder(2)}The name of the second subfolder nested in the Hot Folder.

Example:
C:\Work\Hot_Folder\level1\level2\level3 
Source file subfolder, level 3{*srcfilesubfolder(3)}The name of the third subfolder nested in the Hot Folder.

Example:
C:\Work\Hot_Folder\level1\level2\level3 
Toggle case (switch between upper and lower){SrcFileName("upper")}, {SrcFileName("lower")}Apply case conversion to change text to uppercase or lowercase using values "upper" or "lower". This can be applied to various macroses, for example:

{SrcFileName("upper")}
{SrcFileName("(.*?\'|(.*?)$","upper")}
Date/Time{date(m-d-yyyy)}, {time(h-mm-ss tt)}, {date(yyyy)}, {date(mm)}, {date(dd)}, and moreSeveral macros that insert date and time (in various formats). They include Full date, Year, Month, Day, Full time, Hour, Minute, Second, Millisecond
Email metadata{*MsgDeliveryTime(M-d-yyyy h-mm-ss tt)}, {*MsgSubject}, and moreInformation that can be retrieved from email message files (MSG, EML): Delivery timestamp, To address, From address, Subject, and more.
EXIF{*Exif_ImageDescription}, {*Exif_Make}, {*Exif_Model}, and moreInformation retrievable from a source file's EXIF metadata (typically from photos or image files): Description, Make, Model, Software, Date/Time, GPS Latitude, GPS Longitude
Miscellaneous
Unique sequential file number (in a session){*DocUID}This macro adds a unique sequential number to each document within a session (from "Start" to "Stop" of FolderMill's Processor).

Adding a delimiter between regular expressions

If you're using macros from the Regular expression of original file name group, you can add a delimiter between strings when using a regular expression (). For example, you can use symbols like "-", ";" or "~" as delimiters between parts of the resultant filename.

To specify a delimiter, open the Advanced settings of this Action and enter the desired delimiter in the field Regexp delimiter string

Example

Using Cut all apostrophes macro removes apostrophes from filenames, separating the parts of the filename. You can add a delimiter like "-" between these parts. For instance, Test'name.docx becomes Test-name.docx

Preview your output filename

Want to preview how your filename will look after applying macros? We've got you covered. In the New file name text field, right-click and select Show test panel. This lets you experiment until you achieve the perfect filename.

Preview your output filename

You may also like to read:

Customize Output Names of Converted Files

New help with configuration? Don't hesitate to contact us.