RenameEx - a script-addin for extended "Rename" functionality.
Features summary:
- Automatic numbering of items with support for adding the number of affected/selected items and other counters (derived from Rename to 'file' of 'total files')
Main command line switches:
-
NUMBER Add numbering to items (this wraps the native Rename NUMBER command)
-
Options: = <startindex> Default is 1
-
Switches:
- REMOVENUM Try to remove existing numbering from affected items
- PAD The number of digits in padding, default is "auto"
- PADWITH The characters used for padding, default is "0" (only applies to totals)
- BY Increment when renaming items, default is 1
-
PATTERN Defaults to
(.*?)((?:[^A-z0-9]*|\\s*)?\\D?\\d+.*?)?($|\\..*)
-
TO Defaults to
{stem} {num}{ext}
Following additional vars are available (also the native ones with FILEINFO):
- {num} The ongoing number
- {stem} Item stem or basename (without extension)
- {ext} The items extension (including .)
- {total} Total item count
- {totalfiles} Total file count
- {totaldirs} Total dir count
- {totalsel} Selected item count
- {totalselfiles} Selected file count
- {totalseldirs} Selected dir count
-
Examples:
-
Add basic numbering in front of extension, remove existing numbering at first
RenameEx NUMBER REMOVENUM
-
Add numbering and ".. of x" in front of extension, pad numbers to 3-digits
RenameEx NUMBER PAD=3 TO="{stem}-{num} of {totalsel}{ext}"
-
Do not add numbering, just add "of x" in front of extension, padding as required
RenameEx NUMBER PAD TO="{stem} of {totalsel}{ext}"
-
Enter a new name for all selected items and append numbering and ".. of x"
RenameEx NUMBER PAD TO="{dlgstring|New filename:|{file|noext}} - {num} of {totalsel}{ext}"
-
-
Global switches/options:
- PATTERN Works like the regular PATTERN of the rename command
- FROM Works like the regular FROM of the rename command
- TO Works like the regular TO of the rename command
- FILEINFO Works like the regular FILEINFO of the rename command
- NODESELECT Do not deselect selected items
- PT Switches and options to PassThrough to the native Rename command
-
XLOG Level of output, defaults to normal, which means important information only
- Options: = off,xit,err,inf,warn,,trace,dump
Installation:
To install the command, download the *.js.txt file below and drag it to Preferences / Toolbars / Scripts.
ToDo:
Merge with RenameFromClipboard.
Trouble-Shooting:
In case you encounter errors, add XLOG=dump to your commandline or raise the global log level in the script config.
Then re-do what failed and post the result (output) right here! o)
cya,
tb
Download:
-
Latest: v0.1.1 / 2015.05.24 - unwaned output and padding error fixes:
Command.Generic_RenameEx.js.txt (22.5 KB) -
v0.1 / 2015.05.24 - initial version:
Command.Generic_RenameEx.js.txt (22.3 KB)