hello
Hello,
When we use the code in the Advanced renamer application, when we switch to a different file name, it does not count the numbers from the beginning.
Thanks.
When we use the code in the Advanced renamer application, when we switch to a different file name, it does not count the numbers from the beginning.
Thanks.
You will have to be a lot more specific if you want anyone to help you!
Reply to #2:
I can report the problem with the e-mail address screenshots.
I can report the problem with the e-mail address screenshots.
Reply to #3:
sample
12345_1
12345_2
12345_3
43214_1
43214_2
43214_3
54321_1
54321_2
54321_3
How can I do that ?
Thanks...
sample
12345_1
12345_2
12345_3
43214_1
43214_2
43214_3
54321_1
54321_2
54321_3
How can I do that ?
Thanks...
Reply to #4:
If you want people to help you then you really should take the trouble to explain clearly what you are trying to do!
However I assume that you have renamed your files in such a way that there are duplicate new names and you are using the default Collision Rule to append "_" plus an incrementing number .
If that is the case then you will have to add a Script method to add numbers starting from 1 for each new name.
Provided the NEW filenames are ordered such that duplicate filenames are all together in the list then the following code will work.
In the Pre-batch script:
lastName = "";
And in the main script window:
name = item.newBasename;
log(name);
if (name == lastName) {
n++;
} else {
lastName = name;
n = 1;
}
return name + '_' + n;
If you want people to help you then you really should take the trouble to explain clearly what you are trying to do!
However I assume that you have renamed your files in such a way that there are duplicate new names and you are using the default Collision Rule to append "_" plus an incrementing number .
If that is the case then you will have to add a Script method to add numbers starting from 1 for each new name.
Provided the NEW filenames are ordered such that duplicate filenames are all together in the list then the following code will work.
In the Pre-batch script:
lastName = "";
And in the main script window:
name = item.newBasename;
log(name);
if (name == lastName) {
n++;
} else {
lastName = name;
n = 1;
}
return name + '_' + n;
Reply to #5:
The following code will work with the list in any order...
Pre-batch script:
var names = {};
Main script:
name = item.newBasename;
(n = names[name]) ? n++ : n = 1;
names[name] = n;
return name + '_' + n;
The following code will work with the list in any order...
Pre-batch script:
var names = {};
Main script:
name = item.newBasename;
(n = names[name]) ? n++ : n = 1;
names[name] = n;
return name + '_' + n;