I already posted this answer for another question but this one seemed more relatable in terms of the question, the keywords and the complexity, I will added it here too.
You can use small linux app name krename, with javascript plugin turned on. It is a free tool with very powerful renaming capabilities.
- Install Krename and open it
- Add files
Go to plugins tab and add your javascript function to function definitions section, something like this:
var files = [
"Mickey",
"Donald",
"Duffy"
];
function rename(){
// krename_index is one of many special variables which can be added via ui
return files[krename_index];
}
This is a simple script that gets the job done, but it can be as complex as you like.
Go to filename tab and call your function in the template input as shown below:
[js; rename()]
You can prefix the above code with $
to keep the original file name and add to it. You can use "Functions" button to experiment further.
- Preview new names and complete renaming by clicking Finish button.