Many thanks.
Here is my final code:
Option Explicit
Function OnClick(ByRef ClickData)
Dim strFileName
Dim arrFileName
Dim strDate
Dim strTime
Dim strDateTime
Dim strCommand
Dim x
dim DOpusRTPath
DOpusRTPath = "C:\Program Files\GPSoftware\Directory Opus\dopusrt.exe"
Dim Shell
Set Shell = CreateObject("WScript.Shell")
Dim Progress
Set Progress = ClickData.func.command.progress
Progress.Init ClickData.func.sourcetab.lister, "Zeitstempel aus Dateiname zu EXIF-Meta"
With Progress
.pause = false
.abort = true
.skip = true
.owned = true
.bytes = false
.full = false
.AddFiles ClickData.func.sourcetab.selected_files.count
End With
Progress.Show
Progress.SetStatus "Übertrage Zeitstempel..."
arrFileName = Array()
for each strFileName in ClickData.func.sourcetab.selected_files
if Progress.GetAbortState = "a" then
Progress.Hide
WScript.Quit
end if
if Progress.GetAbortState = "s" then continue
arrFileName = split(strFileName, " - ")
if ubound(arrFileName) = 1 then
strDate = replace(right(arrFileName(0),10),"-",":")
strTime = replace(left(arrFileName(1),8),".",":")
end if
if len(strTime) < 8 then WScript.Quit
strDateTime = strDate & " " & strTime
Progress.SetName CStr(strFileName)
Progress.Stepfiles 1
strCommand = "C:\Windows\exiftool.exe -createdate=""" & strDateTime & """ """ & strFileName & """"
Shell.Run strCommand,0,True
strCommand = "C:\Windows\exiftool.exe -datetimeoriginal=""" & strDateTime & """ """ & strFileName & """"
Shell.Run strCommand,0,True
strCommand = """" & DOpusRTPath & """ /cmd SetAttr FILE=""" & strFileName & """ CREATED=""" & replace(strDate,":","-") & " " & strTime & """ MODIFIED=""" & replace(strDate,":","-") & " " & strTime & """"
Shell.Run strCommand,0,true
strCommand = "cmd /c del """ & strFileName & "_original"""
Shell.Run strCommand,0,True
next
Progress.Hide
End Function
The only problem I have is, that the SKIP- and ABORT-button won't appear.
any suggestions?