I just wanted to share this nice (part of a) batch operation that can be used to rename the pictures when saving them in a batch operation. Thanks to Vlasta for his very kind help.
Use the JavaScript operation instead of Batch - Save Result. Then the following code must be used:
Configuration:
Configuration.AddEditBox("name", "Name", "Base of file name.",
Configuration.GetValueOrDefault("name", "_name_"));
Execution:
var save = Operation.Create("Batch - Save Result");
save.OutputPath = "%FOLDER%\\modified\\" Configuration.GetValue("name") "-%INDEX%.%EXT%";
Operation.Execute(save, Document, Context);