saleguas/context_menu

Command_vars dont work correctly with spaces in filename

saalaus opened this issue · 1 comments

The script does not escape file paths with quotes, so it does not work properly if there are problems in the file path

cm = menus.ContextMenu("Converter", type=".mp4")
cm.add_items(
    [menus.ContextCommand("to mp3", "C:/ProgramData/chocolatey/bin/ffmpeg.exe -i ? test.mp3", command_vars=['FILENAME'])]
)
cm.compile()

For file path: "C:\Users\saala\Videos\Base Profile\test123.mp4"

Execute script: C:/ProgramData/chocolatey/bin/ffmpeg.exe -i C:\Users\saala\Videos\Base Profile\test123.mp4 test.mp3
^ this dont work correctly

Same issue here. Did you find any fix to this? I contemplate a workaround by changing the executed command in a way for it to first merge the split file-subnames into the correct filename, but that is an annoying way.
(I'm running py 11 @ win 11)