OK, this is going to require a new build of Retrobatch to work, but I’ve got it going for you now. The new version allows you set set metadata values from JavaScript, which is what we’ll do with the updated version of the workflow.
So, first grab the updated version of Retrobatch from here: Latest Builds from Flying Meat
And then here’s an updated version of the workflow: name_underscore_watermark.retrobatch (5.4 KB)
The JavaScript now looks like this:
function processAsset(document, jsnode, asset) {
var fileName = asset.outputFileName();
var underscoreLocation = fileName.indexOf('_');
if (underscoreLocation > 1) {
var newName = fileName.slice(0, underscoreLocation);
// Set the title metadata, using ImageIO keys.
asset.setMetaValue_forPropertyName_inMetaDictionaryName(newName, kCGImagePropertyIPTCObjectName, kCGImagePropertyIPTCDictionary);
}
else {
console.log("Missing underscore in " + fileName)
}
return true;
}
Let me know how it works out!