#1 : 25/01-19 10:02 must
Posts: 2
|
Hi,
Is there any way to rename the files in advanced renamer in this order: 1a, 1b, 2a, 2b, 3a, 3b and on.. (also it doesnt have to start with 1, the number should repeat itself and ends with a and b consecutively) thanks in advance. |
#2 : 25/01-19 17:42 L B
Posts: 74
|
Reply to #1:
Hmmm... maybe you can modify the example script to incorporate your requirement: https://www.advancedrenamer.com/user_guide/examp le_scripting |
#3 : 28/01-19 06:09 must
Posts: 2
|
Reply to #2:
thanks for the help, on the other hand I know nothing on scripting to modify. |
#4 : 28/01-19 12:41 David Lee
Posts: 1125
|
Reply to #3:
It should be very easy to work out how to modify the example in the User Guide with a minimal amount of online research! However - as I'm feeling generous... Declare a variable and initialize to one less than your starting value in the Pre batch script eg: to start numbering from 1a : var x = 0; Then in the main script window: var str = index % 2 ? 'b' : 'a'; if (str =="a") x++; return x + str; This will return filenames: 1a, 1b, 2a, 2b, 3a, 3b etc |
#5 : 15/02-19 09:49 _H_
Posts: 8
|
Reply to #1:
|
#6 : 15/02-19 11:45 David Lee
Posts: 1125
|
Reply to #5:
Assuming that you intend the batch script to be: return getCount(index); the Pre batch script needs to be: var n = 0, chrs = ['b', 'a']; function getCount(index){ var i = (index + 1) % 2; n += i; return n + chrs[ i ]; } Otherwise the sequence returned will be: 0b, 1a, 1b 2a, 2b etc |
#7 : 15/02-19 11:50 _H_
Posts: 8
|
Reply to #6:
|
#8 : 15/02-19 12:05 David Lee
Posts: 1125
|
Reply to #7:
That, of course, does exactly the same job. However, without specifying how to use the function your solution would be useless unless the OP is familiar with the use of functions in JavaScript - in which case he wouldn't have needed to ask the question anyway! |