String cleaning for filenames in external control code variables

I have a "button"* to invoke FFMPEG to make a simple video excerpt. It works fine if the dlgstring inputs are less than 1 minute and hence have no colons, but of course colons can't be used in filenames, so this doesn't work in general. How can I do some kind of string replace on the value of the variables? I'd be happy to change the colon to a singlequote or hyphen or underscore or whatever.

<function type="batch">
 <instruction>@set startpoint={dlgstringS|start point in seconds</instruction> 
 <instruction>@set endpoint={dlgstringS|end point in seconds}</instruction>
 <instruction>ffmpeg -i {file$} -ss {$startpoint} -codec copy -to {$endpoint} &quot;{file$|noext}[{$startpoint}-{$endpoint}]{file|ext}&quot;</instruction>
</function>

*I use DOPUS 100% mouseless with no visible buttons or menus, so my "buttons" are in DCF files called via Autohotkey.

You can do this in Opus 13 using the evaluator; in Opus 12 you'd probably need to replace your batch file with a script.

1 Like