Selectively disable nofilenamequoting?

I am trying to create a button that will take the full paths of two files selected in the lister, and use those with MKVMerge to merge the two files together, outputting to a named folder.

The use case is for merging subtitle .SRT files into the parent's video file.

To do this, I need to run an external command that looks like this:

mkvmerge -o <dest> <source files>

This seems simple enough, but there's a complication. For <dest>, I want to take the filename only of the selected file, change it's extension to mkv, and also change it's folder from the folder containing the selected files to a hard-coded one.

So my command becomes:

mkvmerge -o "D:\Movies\{file$|ext=mkv}" {allfilepath$}

This doesn't work, because {file$} is putting quotes around the filename, breaking the constructed destination path.

If I stick @nofilenamequoting in the command, that works, but then {allfilepath$} breaks because the individual paths there are no longer quoted and mkvmerge gets confused.

So, is there a way to selectively disable the quoting?

Or another way I can achieve what I'm trying to do?

Thanks!

This seems to work:

@firstfileonly 
mkvmerge -o D:\Movies\{file$|ext=mkv} {allfilepath$}

That doesn't seem to solve the issue of the filenames being quoted.

With @firstfileonly or not, the command seems to end up being, for example:

mkvmerge -o D:\Movies\"Star Wars.mkv" "D:\Temp\Star Wars.mp4" "D:\Temp\Star Wars.srt"

It's the quotation marks around the output file at the start that it doesn't like.

Have you seen that from testing, or just assumption?

It isn't what happens here. The quotes are added around the whole path, not just the filename, when using lxp's command.

1 Like

Huh, I somehow missed that he'd removed the quotes around the start of the path. My bad.

Thanks guys.