Multiplication & Division?

Advanced Renamer forum
#1 : 20/01-19 05:31
David
David
Posts: 5
Hi all
Does anyone know if it's possible to apply multiplication or division to the file name (number)?

eg: 3.txt , 6.txt ==> 12.txt , 24.txt


20/01-19 05:31
#2 : 20/01-19 11:38
David Lee
David Lee
Posts: 245
Reply to #1:
Easy if you use a script...

return item.name * 4;

For basic scripting information see: www.advancedrenamer.com/user_guide/method_script and www.advancedrenamer.com/user_guide/example_scripting

Use Google to obtain details of Javascript syntax - I find pages at www.w3schools.com/js most useful.


20/01-19 11:38
#3 : 22/01-19 05:55
David
David
Posts: 5
Reply to #2:
Thanks!
I have basic c++ knowledge, but know nothing about java.
I think having a full list of usable functions/variables of Advanced Renamer would be very helpful.

Anyway, how do we return the number which is at a specific position?

eg: abcd_xyz4.txt


22/01-19 05:55
#4 : 22/01-19 12:35
David Lee
David Lee
Posts: 245
Reply to #3:
To be fair to Kim, he added the JavaScript facility for "JavaScript experienced user[s]". If you read his User Guide you will see that he has provided links to JS documentation: JavaScript Reference & JavaScript Guide (www.advancedrenamer.com/user_guide/method_script).

Like yourself, I had no previous knowledge of JavaScript (or Regular Expressions). However it is not difficult to sort out problems using online resources.

For example: item.name.match(/\d+$/) will return the number at the end of a filename.


22/01-19 12:35
#5 : 25/01-19 17:51
David
David
Posts: 5
Reply to #4:
Thanks!


25/01-19 17:51