PDF-ShellTools > General

bulk: rename files with folder name

(1/1)

Nick Riviera:
Hi,

Does PDF-ShellTools  have capability to rename files with folder name..?

ex:

folder name:
"November2020"

files that are in this folder:
"November2020_01.pdf"
"November2020_02.pdf"
"November2020_03.pdf"
...

Thank you very much.

RTT:
You can do it with the renamer tool.
You need to add a script function that will be used to get the folder name. To do that, open the scripts editor, functions menu Scripts>Manage scripts, and create a new script called FolderName with this code in it:

--- Code: ---function FolderName() {
    var parts = BatchFile.Filename.split('\\');   
    return parts[parts.length - 2]
}

--- End code ---
Or, from the script editor main menu, import the attached FolderName.myscript file.
Close the script editor, saving the changes.

You can now set a rename formula like this:

[FolderName]_[Counter:1|1|2|A]

To get file names as in your example.

Nick Riviera:
Thank you!!!

Navigation

[0] Message Index

Go to full version