Hi,
Currently, use the JavaScript renaming engine (one-pass) to test the two metadata fields and pick the first present value. This is exactly what you described and is easy to do. It also lets you format the date consistently.
If you must avoid scripting: there is no built-in “failover-within-a-single-tag” operator. The {default:...} formatter exists but its argument must be literal text (you cannot put another tag inside it), so it cannot be used to call a second tag as a fallback. Could be an improvement for the future.
Example JavaScript solution
1) Make sure you have MediaInfo support installed (MediaInfo DLL) so the MediaInfo tags are available.
2) Open Special (14) -> Javascript Renaming and paste a small script like this:
- Code: Select all
// get Encoded Date (MediaInfo) or fall back to file created date
var d = filePropertyDate("MediaInfo:Encoded_Date") || filePropertyDate("MediaInfo:File_Created_Date_Local");
if (d) {
// format as YYYY-MM-DD (change pattern if you want time, etc.)
var pref = formatDateTime(d, "YYYY-MM-DD");
// choose separator you want, here underscore and dash example:
newName = pref + "_" + name;
} else {
// neither date present — leave name unchanged (or set some default)
newName = name;
}
Notes and tips
- Change the formatDateTime pattern ("YYYY-MM-DD") to include time or different separators (example "YYYY-MM-DD_HH-mm-ss") if you want time too.
- If you want the date to be suffixed instead of prefixed, move the formatted date to the end: newName = name + "_" + pref;
- This runs in a single pass and only adds the first available date — exactly the failover behavior you asked for.
- If you need different formatting per-field (e.g., Encoded_Date has a different native format), convert each to Date and then format as you like (filePropertyDate returns a Date or null).