Option Explicit
Function OnClick(ByRef clickData)
Dim strDateTime, strCommand, selItem, re, cmd
Set re = new RegExp
re.IgnoreCase = True
re.Global = False
' Name, ignoring extension, should be something like "2011-07-29_082609"
re.Pattern = "^(\d\d)-(\d\d)-(\d\d)"
Set cmd = clickData.func.command
cmd.ClearFiles
For Each selItem in clickData.func.sourcetab.selected
If (re.Test(selItem.name_stem_m)) Then
' Set strDateTime to a string like "2011-07-29 08:26:09"
strDateTime = re.Replace(selItem.name_stem_m, "20$3-$2-$1")
' DOpus.Output "DT = " & strDateTime
strCommand = "SetAttr FILE=""" & selItem.RealPath & """ MODIFIED=""" & strDateTime & """"
' DOpus.Output "CMD = " & strCommand
cmd.RunCommand strCommand
End If
Next
End Function
Here is a better screenshot. The left side is meant to be in chronological order, the right side is the one which has the wrong "created" stamps (in my example it is a bit exaggerated, though).
Is your goal to manipulate the folders' metadata to get the right sorting order? That will never work properly. The only way is to rename the folders into a sortable (ISO) format. The best way to do this is a Rename script.
Thanks, i'm also investigating. I actually did not use that rename panel for many years, only my customized MP3 renaming tool bar, so i forgot a lot of stuff. Now i have found how to import the orp intoo the extended rename section. I will make a test run on some copies of my photo folders.
I think it would work with the Created timestamp. AFAIK that won't normally be changed. (Using the Modified timestamp instead would be a bad idea though, on folders.)
I have copied the js script into the field, but it won't let me safe it. Either i abandon it, or i can't click "ok". Sorry for not understanding all this stuff. Thanks for trying to help me.