Sample files can be obtained here - https://www.sugarsync.com/pf/D7077653_05355703_181621
I have this script assigned to my custom toolbar button:
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");
$whenTaken = property("WhenTaken", $item);
if ($whenTaken == '') { continue; }
$date = formatdate($whenTaken, "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
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
Thanks in advance for helping.