Right, i just realized this too, Sorry.admin wrote:No, the comma has to stay:
Good point.BTW, if $CamMod is the same for each file, the script can be done much easier, and with a summary preview for all files...
In the meantime i have tried to do the preview on my own:
Code: Select all
$list = get("SelectedItemsNames", "|");
$array="";
$index=1;
while($index < 20)
{
//get one after the other file from file list $file:
$file = gettoken($list, $index, "|");
if ($file==""){break;}
//read property from actual file:
$CamMod = property("CameraModel", $file);
//trim space and tabs around the reported property:
$CamMod = regexreplace($CamMod, "\s*|\t*(.*)\s*|\t*", "$1");
//Property #25 is on my system Exif Date Taken. YMMV.
$DateTaken = replace(property(#25, $file),":","");
$DateTaken = regexreplace($DateTaken,"(\d\d)\.(\d\d)\.(\d\d\d\d)(.+)","$3.$2.$1$4");
$ExtPos = strpos($file, ".", strlen($file) -5);
$fileBase = substr($file, , $ExtPos);
$fileExt = substr($file, $ExtPos);
$file = "$DateTaken~$fileBase";
if ($CamMod != ""){ $file = "$file"."_"."$CamMod"}
$file = "$file$fileExt";
$array = "$array$file<crlf>";
//precess next file:
incr $index;
}
text $array;
msg "OK to rename or cancel?",1;
msg "if you have pressed OK you will see this dialog too.";
//rename code goes here:
XYplorer Beta Club