The Rename internal command can be used to:
Command Arguments:
Argument |
Type |
Possible values |
Description |
---|---|---|---|
(no argument) |
- |
- |
Displays the Rename dialog. The rename operation
will be performed on all selected files and folders. The dialog will open
in the last mode it was used in (either simple or advanced). |
ADVANCED |
/S |
(no value) |
Displays the Rename dialog in advanced
mode. |
AUTORENAME |
/S |
(no value) |
Automatically adds an incrementing number to the end of new filenames
if they clash with existing
files. |
BY |
/K/N |
<increment> |
Specifies the increment when renaming files with automatic numbering
(using the NUMBER option). If not specified the default
increment is 1. |
CASE |
/K |
upper |
Converts filenames to all-upper
case. |
|
|
lower |
Converts filenames to all-lower
case. |
|
|
firstword |
Capitalizes the first letter of the
filename. |
|
|
allwords |
Capitalizes the first letter of each word of the
filename. |
|
|
extupper |
Converts the filename extension to upper
case. |
|
|
extlower |
Converts the filename extension to lower
case. |
FINDREP |
/O |
(no value) |
Enable find-and-replace mode. The PATTERN argument
must be used to provide the string to find, and the TO
argument provides the string to replace it with. You can optionally
combine this with the REGEXP
argument. |
|
|
ext |
Makes find-and-replace operate in the filename extension as well as in
the stem of the filename. |
FROM |
|
<filename> ... |
Renames the files specified on the command line, rather than those
selected in the source file display. This argument can accept filenames or
wildcard
patterns. Remember to enclose each filename in quotes if it contains
spaces. |
IGNOREEXT |
/S |
(no value) |
Turns on the Ignore extensions option for the rename
function. Filename extensions won't be affected and don't need to be
accounted for in any wildcard patterns. Example: Rename PATTERN * TO *_backup IGNOREEXT The Ignore extensions option is off by default for non-interactive renames, to avoid breaking old buttons. You only need to use the IGNOREEXT argument with rename commands which specify everything on the command line and do not open the Rename dialog. The Ignore extensions option is on by default for interactive renames which open the dialog. You can turn the option off in the dialog via the separate NOIGNOREEXT argument, documented below. |
INLINE |
/O |
(no value) |
Activates inline
renaming on the item in the source file display that currently has
focus. |
|
|
all |
Automatically selects the entire filename for
editing. |
|
|
name |
Automatically selects the filename's stem (but not the extension).
Selects the whole name for a
folder. |
|
|
endstem |
Positions the cursor at the end of the filename's stem (before the
extension), but does not automatically select any part of the
name. |
|
|
ext |
Automatically selects the filename's extension. Selects the whole name
for a folder. |
|
|
home |
Positions the cursor at the beginning of the
filename. |
|
|
end |
Positions the cursor at the end of the
filename. |
|
|
single |
If more than one item is selected, the Rename dialog
will be displayed. Without this, inline rename will begin on the focused
item only. |
MACRO |
/K |
|
Lets you specify a rename macro operation string. You can use the macro
builder in the Rename dialog to generate these strings and then hardcode
them in a command. Example: Rename MACRO R0-6/L0+Final |
MATCHCASE |
/S |
(no value) |
Makes the rename operation case-sensitive. Patterns and search strings
must match the exact case of the
filename. |
NOFILEINFO |
/S |
(no value) |
Disable file information metadata insertion. For example, the
string {mp3title} would normally insert the title of an
MP3 file in the new filename. With NOFILEINFO specified,
the literal string "{mp3title}" would be inserted in the new
filename. Example: Rename PATTERN * TO *_{name} NOFILEINFO |
NOIGNOREEXT |
/S |
(no value) |
Turns off the Ignore Extension option in the Rename
dialog when it first opens. You only need to use this argument when
opening the Rename dialog for interactive
use. For non-interactive use of the Rename command, the Ignore Extension option is off by default (to avoid breaking old buttons) and can be turned on via the separate IGNOREEXT argument, documented above. |
NOMATCHNOFAIL |
/S |
(no value) |
Files which do not match the rename pattern are not 'failed'. This can
be useful with multi-line functions which need to do some optional
renaming before passing all of the files to additional commands. |
NUMBER |
/O |
(no value) |
Automatically number files. Selected files will be numbered in the
order they are presented in the file display, so you should make sure the
list is sorted as desired before using this command. The number 1 will be
assigned to the first selected file, and the number for each subsequent
file will be incremented by the value given for the BY
argument (or by 1 if BY is not
provided). |
|
|
<start> |
Number files starting with the specified number. Providing a value for
NUMBER also lets you zero-pad the assigned number. For example, the value
0010 means to start numbering at 10, and zero-pad to four
digits. The [#] marker can also be used to specify
zero-padding - [#5] would zero-pad to five
digits. If you add a ! before the number, you can use this
argument to specify the default value for the corresponding field in the
Rename dialog without actually turning on the sequential numbering option.
For example, you may want a default of "01" so you get padding to two
digits without having to type the extra "0" every time you turn on the
option in the UI. If you make use of that, you should also include the
ADVANCED argument so the Rename dialog appears, instead
of it silently performing a rename
operation. |
PATTERN |
/K |
<pattern> |
Specifies a wildcard pattern that represents the old (original)
filename. This argument is used when performing a wildcard rename. The
Rename command supports a simple wildcard syntax where one or more
asterisks supplied for the PATTERN argument can be used
to copy parts of the original name to the new name. The
PATTERN argument is also used in conjunction with
REGEXP to provide the search pattern for a regular
expression rename, and in conjunction with FINDREP to
provide the search string for a find-and-replace rename. |
PRESET |
/K |
findrep |
Opens the Rename dialog in Find and Replace
mode. |
|
|
regexp |
Opens the Rename dialog in Regular Expression
mode. |
|
|
regexpfindrep |
Opens the Rename dialog in Regular Expression +
Find and Replace mode. |
|
|
last |
Specifying PRESET=last opens the Rename dialog showing the settings from the last time the dialog was used. Similar to opening the dialog and clicking the Last Rename button.
Example: Rename PRESET=last
You can also use !last to apply the last rename
automatically, without showing the Rename dialog
first. |
|
|
!list |
Displays a generated list of saved rename presets (acts as a dynamic button). Selecting a preset from the list will apply that rename operation to the currently selected files and folders.
The generated list can be controlled with the addition of the following keywords:
Example: Rename PRESET=!list,favesonly |
|
|
<preset> |
Applies the named saved rename preset to all currently selected files
and folders. Rename presets are created through the Advanced Rename
dialog. |
RECURSE |
/S |
(no value) |
The rename operation will operate recursively on all files inside
selected sub-folders. |
REGEXP |
/S |
(no value) |
Enables regular expression mode. The search pattern must be provided
with the PATTERN argument, and the replace pattern with
the TO argument. You can optionally combine this with the
FINDREP
argument. |
RENAMEMATCHING |
/S |
(no value) |
Keeps files with the same stem and different extensions together when
renumbering. For example, IMGP1032.JPG and
IMGP1032.WAV when renamed would be given the same
number. |
SCRIPTARG |
/K/M |
<option:value>, |
Used to pass custom field values to a rename script. Example: Rename PRESET MyRename SCRIPTARG my_option:True |
SIMPLE |
/S |
(no value) |
Displays the Rename dialog in simple
mode. |
TO |
/O |
<new name> |
Specifies the new name of the file to rename. This argument is also
used to specify the 'to' pattern when renaming using wildcards or regular
expression, and the 'replace' string when renaming in find-and-replace
mode. This argument can also be provided without a value when doing a
find-and-replace rename - in that case, the search string would be
replaced with nothing. |
TYPE |
/K |
files |
Force the rename to only operate on files - any selected folders will
be ignored. |
|
|
dirs |
Force the rename to only operate on
folders. |
WHENEXISTS |
/K |
ask |
Controls what happens if the new filename already exists. The default
action is to ask the user for each existing
file. Example: Rename PATTERN * TO *.bak WHENEXISTS=ask |
|
|
delete |
Performs the rename as requested, deleting the file that already
existed. Example: Rename PATTERN * TO *.bak WHENEXISTS=delete |
|
|
keep |
Performs the rename as requested, renaming the old file that already
existed. Example: Rename PATTERN * TO *.bak WHENEXISTS=keep |
|
|
rename |
Modifies the new name by adding a suffix to make it
unique. Example: Rename PATTERN * TO *.bak WHENEXISTS=rename |
|
|
skip |
Skips any files that already exist, without performing the
rename. Example: Rename PATTERN * TO *.bak WHENEXISTS=skip |