I assume that you want at least fall back to the created date if there isn't any exif date?
If that's the case, this should work...
It's only valid for date formats like
day.month.year
day-month-year
day/month/year
Code: Select all
foreach($file, listpane(, , 1)) {
// Exif date (pictures)
if regexmatches(getpathcomponent($file, "ext"), "jpg|jpeg|tiff") {
$date = property("#image.datetaken", $file);
}
if (!$date) {
// Switch to creation date if exif date not found
$date = property("#date.c", $file);
}
// Change date to yyyy-mm-dd
$date = regexreplace($date, "^(\d+)(?:\.|-|/)(\d+)(?:\.|-|/)(\d+)(.*)", "$3-$2-$1");
moveto $date, $file, , 2;
}