

If we also want to add the image dimensions to the filename in the script we can use a script like this (assuming we are renaming image files): So what else can we do? By using the properties of the item object we can access all information about the particular item available to the Advanced Renamer batch runner. This script will by using the index input parameter, produce the exact same result as the previous script. Notice how the last line is the same but the two first lines for calculating the str variable has changed. Try to remove the pre batch script and instead use this script in the script panel: But to demonstrate the pre batch script I made it a bit more complicated than necessary. Most methods in the program is by default configured to only work with the name part of the filename, but when it comes to the scripting method, you need to return a complete filename including the extension. Notice that we return a complete filename including the extension. Statement is the line telling Advanced Renamer what the new filename of the item should be. In the script we will use the global variable named odd setup in the pre batch script, and use it to insert either A or B into the filename. Type this into the Pre Batch Script editor: This is a good place to setup a global state variable.

The script created here will only get run once for every batch run.

A window displaying a new script editor will appear. This is done by clicking the Pre Batch Script button. Typing item and hitting dot will show a list of properties on the item object.īefore creating the actual script we need to setup a global variable. The input parameter item contains the item from the list and its many properties. The script is executed once for each item in the list. In the script editor we can create the script needed for producing the new filenames. Make sure this is the only method in the panel. Then add the Script method to the method panel. We want the resulting filenames to end up like this:įirst add the files to Advanced Renamer. Imagine we have a lot of files where we want all odd files to end with A and all even to end with B.

This is why I added JavaScript support to the program and in the next paragraphs I will show you how it works. Sometimes the particular task is so complex and so specialized that the batch methods supplied with Advanced Renamer cannot help the user. I often get various questions at the forum for how to use the program and how to configure it for various tasks.
