Counting/looping in scripts

Advanced Renamer forum
#1 : 20/04-17 10:59
Tajs
Tajs
Posts: 2
Hi i am new to Aren and Javascript. but i found Aren real usefull for renaming.

i have some trobule with the script metod, i tried to make a script out snippets that i found on the forum .

My conditions is that have 300+ folders each cointaining 5-6 files, i want the renamer to count to 250 and the restart.

My folder struture is as follows:
001
-image1.jpg
-image2.jpg
-image3.jpg
-image4.jpg
-image5.jpg

002
-image1.jpg
-image2.jpg
-image3.jpg
-image4.jpg
-image5.jpg

003
-image1.jpg
-image2.jpg
-image3.jpg
-image4.jpg
-image5.jpg

004
-image1.jpg
-image2.jpg
-image3.jpg
-image4.jpg
-image5.jpg

005
-image1.jpg
-image2.jpg
-image3.jpg
-image4.jpg
-image5.jpg

ex.
first file would be:
[001,001]Image1.jpg

and the last to be:
[250,250]imagename.jpg

is like a kind of bank system, if you get me. but i need all the small folders filled up before switching to a new bank.

Here is the script i tried with, Hope i makes sense:

var batchSize = 251
var currIndex = app.currentIndex +1
var batchCount = parseInt(currIndex / batchSize) + 001
var fileCount = parseInt(newFileIndex / batchSize) + 001
var newFileIndex = ("00" + currIndex).slice (-3)
var filename = '[' + ("00" + batchCount)+ ',' + ("00" + currIndex).slice (-3) + ']' + (newFileIndex)

return filename




20/04-17 10:59 - edited 20/04-17 11:04
#2 : 21/04-17 06:34
Tajs
Tajs
Posts: 2
Reply to #1:
Solved


21/04-17 06:34