Renaming images using incremental numbers

Advanced Renamer forum
#1 : 14/03-16 10:09
Warren Kruuse
Warren Kruuse
Posts: 2
Hi all

Been pulling my hair out trying to perform the following function.
So we need to rename a large folder of images in the following pattern.

So we have a specific blue VW car as image 1, then the same car taken from various other angles totaling 6 individual images, so we're hoping to have the image names changed from DSC001, DSC002 etc changed to 1, 1-1, 1-2, 1-3 etc. Then when we have a different car, it will then become: 2, 2-1, 2-2, 2-3, etc...

Obviously the system can't detect the change in cars, but surely we can batch rename via ticked/selected files?

Many thanks

Warren


14/03-16 10:09
#2 : 14/03-16 22:33
Stéphane Déom
Stéphane Déom
Posts: 2
Reply to #1:
Hi Warren,

I think this small script will do :


function(index, item) {
var val1 = ((index / 6) | 0) + 1;
var val2 = index % 6;
var val = val1;
if (val2 > 0) {
val = val + '-' + val2
}
return val;


Kind regards,

Stéphane


14/03-16 22:33
#3 : 15/03-16 11:32
Warren Kruuse
Warren Kruuse
Posts: 2
Hi Stéphane

Thank you for the assistance. I have tested it, but I'm getting the following error:

Invalid script: line 0: itemFunc is not defined

Any suggestions?


15/03-16 11:32
#4 : 17/03-16 21:36
Kim Jensen
Kim Jensen
Administrator
Posts: 775
Reply to #3:
Note the line
function(index, item) {
should not be inserted into the text area. It will automatically be added by the batch script engine.


17/03-16 21:36