How to do repetitive DOS command on selected files?

I need to process a large list of files within the same directory. They all are HTML and I want to run a Perl script over them, which converts them to text/plain.

What I have done now is to set up a button, that would let me choose the command to be run on these files by using this:

{Rf} {Rs} {F}

It does not function. What am I doing wrong ? I invoked the command like this:

perl C:\foo\bar\html2txt -inputfile {f} -outputfile {f|ext=txt}

and it fails. Also similare tries fail.

My guess is you simply have the command-line for the Perl script wrong.

Also, if the file paths have spaces in them, make sure the script (or the perl interpreter) understands quoted filenames on the command-line properly. Opus will add quotes but only when needed due to spaces.

As a test I made an Opus button which runs this:

echo perl C:\foo\bar\html2txt -inputfile {f} -outputfile {f|ext=txt}
pause

Set it to MS-DOS type (so the pause command works) and if you run it on some files (in this case all in F:\ and called Marla_X.tib where X is from 1 to 9) then you'll see this output:

perl C:\foo\bar\html2txt -inputfile F:\Marla_1.tib -outputfile F:\Marla_1.txt
perl C:\foo\bar\html2txt -inputfile F:\Marla_2.tib -outputfile F:\Marla_2.txt
perl C:\foo\bar\html2txt -inputfile F:\Marla_3.tib -outputfile F:\Marla_3.txt
perl C:\foo\bar\html2txt -inputfile F:\Marla_4.tib -outputfile F:\Marla_4.txt
perl C:\foo\bar\html2txt -inputfile F:\Marla_5.tib -outputfile F:\Marla_5.txt
perl C:\foo\bar\html2txt -inputfile F:\Marla_6.tib -outputfile F:\Marla_6.txt
perl C:\foo\bar\html2txt -inputfile F:\Marla_7.tib -outputfile F:\Marla_7.txt
perl C:\foo\bar\html2txt -inputfile F:\Marla_8.tib -outputfile F:\Marla_8.txt
perl C:\foo\bar\html2txt -inputfile F:\Marla_9.tib -outputfile F:\Marla_9.txt

So it looks like Opus is doing what you would expect, suggesting the command-line just isn't right for either perl or the perl script.