Filename writing from regex

This is possible!

You can do it with a JavaScript node, with the contents as such:

function processAsset(document, jsnode, asset) {
    var currentName = asset.outputFileName() + ""; // make sure it's a js string.
    
    // Apply a regex to the name.
    currentName = currentName.replace(/t/g, "X");
    asset.setOutputFileName(currentName);

    // Just another example here, of setting values to be used in the token fields.
    asset.setUserValue_forKey("FOO", "myKey");

    return true;
}

So that’ll rename the file name, replacing all ‘t’ characters with a capital X.

Then we also add a little “userValue” of “FOO” for the key of “myKey”. That value is then referenced later on in the write node like so:

I hope that makes sense. I’ve basically shown two different ways to assign values to the file name.