Customize Output Names of Converted Files

FolderMill offers various ways to set up the naming of output files. This article provides instructions on how to configure naming patterns for files converted by FolderMill.

Adjusting the naming pattern with the Output filename template setting

When splitting a PDF into smaller PDFs or converting documents to image format, such as JPG, PNG, or TIFF, you can change how output files are named. To do it, open the Action's Advanced settings and find the setting Output filename template.

Output filename template in FolderMill

The default output name is: {*SrcFilename}{*WorksheetName}{*SrcFileMPageNo}.{*DstFileExt}

  • {*SrcFilename} – stands for source file name;
  • {*WorksheetName} – stands for worksheet file name (usually applicable for Excel or CAD files);
  • {*SrcFileMPageNo} – stands for source file page number ("M" implies "multiple pages", hence this macro avoids adding page number "1" to single-page files);
  • {*DstFileExt} – stands for destination file extension.

You can modify the output file name template as you like by entering your own text or adding characters like dots, dashes, underscores and the like. Your text can also be combined with macros.

Avoid using the following characters as they are forbidden in Windows filenames:

< (less than)
> (greater than)
: (colon)
" (double quote)
/ (forward slash)
\ (backslash)
| (vertical bar)
? (question mark)
* (asterisk)

Note: this does not apply to macros. Macros may contain any characters.

Adding built-in macros

Click the {=} icon to access built-in macros that can be added to meet your needs. A macro is a value or expression that pulls data from the metadata of the source file. This data can include the filename, file path, file attributes (such as creation date and time), or other information like the computer or user's name.

Most macros extract data from the source file metadata. If some data is missing from the file, the corresponding macro value will be left out.

Adding built-in macros in FolderMill

Description of all available macros

You can modify the default output filename as you like, with the use of the following macros.

You can access all macros through the Macro button ({=}) or enter them manually. The macro name will turn light-green if entered correctly.

Note: macro names are not case-sensitive. That means, both {srcfileext} and {SrcFileExt} will work the same way. Macros may be used with an asterisk character in the beginning (for example, {*SrcFilename} or {*SrcFileFullPath}), which can help prevent using incorrectly entered macros.

Macro/Group of macros Macro Description
Regular expression of source file name {SrcFileName("^(\d+)")},
{SrcFileName("(\d+)$")}
and others

Various 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

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
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")}
Source file extension {*SrcFileExt} File extension. Example: docx
Source file type {*SrcFileType} File type. Example: PNG Image
Source file path, 1-st part {*SrcFileFullpath(1)} The first part of the file path (not including the drive letter). Parts are divided by slash ("/")
Source file path, 2-nd part {*SrcFileFullpath(2)} The first part of the file path (not including the drive letter). Parts are divided by slash ("/")
Source file path, 3-rd part {*SrcFileFullpath(3)} The first part of the file path (not including the drive letter). Parts are divided by slash ("/")
Destination file extension {*DstFileExt} Output file extension. For example: pdf
Worksheet name {*WorksheetName} Worksheet file name (usually applicable for Excel or CAD files)
Container name {*ContainerName} Name of an email message file, an archive (RAR, ZIP, 7ZIP), or a PDF Portfolio file.
Date/Time
Full date {Date(M-d-yyyy)} Date containing month, day, and year.For example: 4-1-2025
Year {Date(yyyy)} Year, for example: 2025
Month {Date(MM)} Month, for example: 04
Day {Date(dd)} Day, for example: 01
Full time {Time(h-mm-ss tt)} Time, for example: 6-03-51 PM
Hour {Time(HH)} Hour, for example: 18
Minute {Time(mm)} Minute, for example: 06
Second {Time(ss)} Second, for example: 14
Millisecond {Time(ms)} Millisecond, for example: 614
Source file last write date {SrcFileDate} Date when the file was last time modified ("Date modified" in file's properties), for example: 04-02-2025
Source file last write time {SrcFileTime} Time when the file was last time modified ("Date modified" in file's properties), for example: 17.50.51
Source file creation date {SrcFileCreationDate} Date when the file was created ("Date created" in file's properties), for example: 04-03-2025
Source file creation time {SrcFileCreationTime} Time when the file was created ("Date created" in file's properties), for example: 13.54.32
Miscellaneous 
Common Documents {*PubDocs} "Common documents" location (C:\Users\Public…)
My Documents {*MyDocs} "My documents" location (C:\Users\Username\Documents)
User name {*User} Windows username (account name)
Computer name {*Computer} PC's name
Pages
Source file pages {*SrcFilePages} The total number of pages
Source file page number {*SrcFileMPageNo} Current page number
Source file page number, 2-digit number / 01 {*SrcFileMPageNo(_{0:D2})} Two-digit page number in the format, for example: Page_01.jpg
Source file page number, 3-digit number / 001 {*SrcFileMPageNo(_{0:D3})} Three-digit page number in the format, for example: Page_022.jpg
Source file page number, 4-digit number / 0001 {*SrcFileMPageNo(_{0:D4})} Four-digit page number in the format, for example: Page_0100.jpg
Source file page number, 5-digit number / 00001 {*SrcFileMPageNo(_{0:D5})} Five-digit page number in the format, for example: Page_00100.jpg
Source file page number, 6-digit number / 000001 {*SrcFileMPageNo(_{0:D6})} Six-digit page number in the format, for example: Page_000100.jpg
Item # in list  {ListItemNo} This macro adds a unique sequential number to each document within a session (from "Start" to "Stop" of FolderMill's Processor).

You can access all macros through the {=} icon or enter them manually. The macro name will turn light green if entered correctly.

You can combine macros with your own text, including various characters like spaces and dots.

Macro names are not case-sensitive. That means, both {*dstfileext} and {*DstFileExt} will work the same way.

Modifying the enumeration of output pages/worksheets

When FolderMill processes a document and divides it into pages or worksheets (saved as image files), it assigns numerical endings to their filenames. This prevents a file with the same name from being overwritten each time a new page is saved.

Enumeration may become important when splitting a multi-page document into smaller parts. For example:

  • A multi-page PDF document is converted into an image format (JPG, PNG, TIFF).
  • An Excel or a CAD file with multiple worksheets is converted into an image format (JPG, PNG, TIFF).
  • A PDF is split by the Convert to PDF Action with the Multipage: Split into single pages option enabled.

What is the default enumeration?

By default, file enumeration follows this naming pattern: <Document name>-<Page number>

For instance, it would look like this: Document-1, Document-2, ... Document-10. Thus, a nine-page document would be converted into PNG files as follows:

Converting a nine-page document into PNG with FolderMill

By default, FolderMill automatically adds the so-called leading zeros on certain conditions – based on the total number of pages in a document. 

  • If the number of pages is equal or less than 10, the files will be named file-1.pdf, file-2.pdf, file-3.pdf, and so on.
  • If the number of pages is more than 10 but equal or less than 100, the files will be named file-01.pdf, file-02.pdf, file-03.pdf… file-020.pdf, and so on.

How to add leading zeros to source file page numbers when splitting a document

You can add more digit positions to the filename and add more zeros to them. For instance, you can alter the naming from "Document-2" to "Document-002".

How to add leading zeros to the output file names

To add more leading zeros:

  1. Next to Output filename template, remove the default macro {*SrcFileMPageNo}.
  2. Instead of the removed macro, click on the {=} icon, navigate to Pages and choose Source file page number, 3 digit number / 001 (or another desired option).
  3. Click OK to save the Advanced settings.
  4. Try converting a few files to make sure the configuration is correct.

As a result, you should get the output files with 3-digit numbers at the end of the filename. 

Output files with 3-digit numbers at the end of the filename

You can modify the {*SrcFileMPageNo(_{0:D3})} macro as you need. For example, change the underscore symbol ("_") to dash ("-") to have names like "A nine-page document-001.png". 

You can increase/decrease the number of leading zeros by manually changing D3 to D2, D4, D5, or D6.

Don't hesitate to contact us if you have difficulty changing the naming pattern or need a custom solution.