The properties to control which buttons are enabled (Progress.skip = true
etc.) need to be set before Progress.Init
is called:
Dim Progress
Set Progress = ClickData.func.command.progress
Progress.skip = True
With Progress
.pause = true
.abort = true
.skip = true
.owned = true
.bytes = false
.full = true
End With
Progress.Init ClickData.func.sourcetab.lister, "Zeitstempel aus Dateiname zu EXIF-Meta"
Progress.AddFiles ClickData.func.sourcetab.selected_files.count
(We'll make this more explicit in the docs as it's easy to overlook.)
Another thing to note: You can't use WScript.Quit
in Opus scripts, since they're running inside Opus rather than WScript. Instead, you can use Exit Function
in the same places.
Using the Opus Command
objects to run the commands instead of Shell.Run
is usually also preferable, and will save you having to run Opus commands via DOpusRT.exe. (You can use it for the non-Opus commands as well.) Similarly, using the Opus Delete command instead of cmd /c del
.
PS: Found a more complete example script that uses the Progress object, in case it's useful to anyone:
PPS: The skip option may not make sense with your script unless any of the individual commands take a long time. If you do support the skip option, you'd want to check if the user wants to skip between each individual command, else there isn't much point to it. (Checking it at the top of the loop is not really useful as you'd be skipping the next file, not the one the user clicked skip on. Checking Abort there makes sense, but not Skip.)