Sequential File Numbers

Hi, new to Retrobatch, quickly got it doing what I want, bar file numbering, I have the following setup

takes and image, crops the left side at 50% and saves, then crops the right side 50% and saves, what I’d like is the file numbers to be sequential.

so first left side is filename1 first rightsize is filename2 next left side is filename3 etc.

Been playing around with javascript, but seem to be able to crash the app a lot.

I’ve searched the forums, but can’t see this as an option

thanks

You can do this with the following JavaScript:

var name_idx = 0;
function processAsset(document, jsnode, asset) {
    name_idx = name_idx + 1;
    asset.setOutputFileName(name_idx.toString() + asset.outputFileName());
    return true;
}

And have your nodes setup like this:

And here’s the sample document:
Seq FN.retrobatch (10.3 KB)

The JavaScript node can be crashy - let me know if you found an example that is making it crash though! Hopefully I can knock all those out.