EXIF Rename..
Posted: 27 May 2015 06:02
Hi all.
I have this script with the help some of you here
The script works fine except for that it will return error if the selected file does not contain the Time Taken (EXIF info). If this happen, I want the script to retain the filename without doing anything.
So, can someone here please help me on how do I prevent such error from occur?
Thank you.
I have this script with the help some of you here
Code: Select all
$shift = 8; // Time (in hours to shift the time)
$previewNames = "";
$ahkHelper = "D:\SugarSync\Programs\Settings\xyEditItemNamesWindow_Helper.exe";
$clip = "<clipboard>"; // Store current clipboard data
foreach($item, <get SelectedItemsPathNames |>, "|") {
$device = property("CameraModel", $item);
$baseName = getpathcomponent($item, "base");
$extension = getpathcomponent($item, "ext");
$date = formatdate(property("WhenTaken", $item), "yyyymmdd.hhnnss", "h", $shift);
if ($device == "SAMSUNG PL150 / VLUU PL150 / SAMSUNG TL210 / SAMSUNG PL151") {
$pattern = "$date-$baseName¬SAMSUNG PL151.$extension";
} elseif ($device == "SM-N9005") {
$pattern = "$date¬SM-N9005.$extension";
} elseif ($device == "808 PureView") {
$fileName = RegExReplace($baseName, "(\S{10})[-](.+)", "$2");
$pattern = "$date-$fileName¬$device.$extension";
} else {
$pattern = "$date-$baseName¬$device.$extension";
}
$previewNames = $previewNames . $pattern . "<crlf>";
}
$previewNames = formatlist($previewNames, "e", "<crlf>");
copytext "$previewNames";
run """$ahkHelper""";
#147;
copytext $clip; // Restore clipboard data
So, can someone here please help me on how do I prevent such error from occur?
Thank you.