Thank you Leo.
It works like a charm!
(It is simple when you know and quite difficult when you have to find each command - when not impossible
I have added two lines to have a date from EXIF (if exists) and modified the checking line so each file starting from 14 digits and ending whatever will have both dates changed.
Sony Play Memories puts both films and images in the same folder. Images regularly have proper dates, but films not (there is no Exif date to correct it). With this version one could set all dates at once if needed (regardless if picture or film).
Function OnClick(ByRef clickData)
Dim re, fileItem, fileDate, cmdString
clickData.Func.command.deselect = False
Set re = new RegExp
re.Pattern = "^(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(.+)$"
For Each fileItem in clickData.Func.sourceTab.selected_files
cmdString = "SetAttr FILE=""" & fileItem.realpath & """ SETATTR META createdate:datetaken lastmodifieddate:datetaken"""
If (re.Test(fileItem.name)) Then
fileDate = re.Replace(fileItem.name, "$1-$2-$3 $4:$5:$6")
cmdString = "SetAttr FILE=""" & fileItem.realpath & """ CREATED=""" & fileDate & """, MODIFIED=""" & fileDate & """"