andy-portmen / native-client

Native Messaging component for Windows, Linux, and Mac OS that is written in NodeJS.
https://add0n.com/open-in.html
Mozilla Public License 2.0
727 stars 474 forks source link

[External Application Bundle] Problem with Quotes on Parameters and Spaces #40

Closed cyberpunkbln closed 7 years ago

cyberpunkbln commented 7 years ago

Hello,

i want to try to give an cmd-batch this

-f bestaudio -x --audio-format mp3 -o "%UserProfile%\Music\Youtube-DL\%(title)s.%(ext)s" [HREF] --write-all-thumbnails

an exe became the excact path but the command not. ^" don't work

what must i type that %7=path_with_spaces?

thx

andy-portmen commented 7 years ago

Try

-f bestaudio -x --audio-format mp3 -o "'%UserProfile%\Music\Youtube-DL%(title)s.%(ext)s'" [HREF] --write-all-thumbnails

as of suggested by https://add0n.com/external-application-button.html#IDComment1049753154

andy-portmen commented 7 years ago

https://add0n.com/external-application-button.html#faq14

cyberpunkbln commented 7 years ago

Hi, yes cool but this is only for PowerShell-Skripting (.ps), the old cli cmd.exe (.cmd,.bat) don't encapsulate strings with spaces in one string.

cyberpunkbln commented 7 years ago

I catch the %* for the whole Argument-String-Param i must say. The Arg-Params can be different. And this string comes unquoted to the cmd-batch-file and single-quotes don't work in oldscool-cmd-cli.

cyberpunkbln commented 7 years ago

Now i have tried to use a cmd to call a pscript or directly the powershell

encapsulate single with double quotes "'[HREF]'" functioned

powershell -Command %~dp0\youtube-dl.exe %*

but i have the problem too, ampersand will not be escaped right

https://www.youtube.com/watch?v=E-lPrWLzGSM&index=1&list=RDQMUQdeRUmKe-Y -> https://www.youtube.com/watch?v=E-lPrWLzGSM&index=1

for dos he must ^& so escaped

i will use dos as an container fpr the pscript or powershell command why here on this pc i don't can set the execution policy, thats the problem

andy-portmen commented 7 years ago

quotes.zip

Try this dev version. There is a new option in the settings to include quotations in the argument list. Let me know if you are not familiar with how to install dev versions.

cyberpunkbln commented 7 years ago

Hello, thx i will try it and leave a comment.

cyberpunkbln commented 7 years ago

Hi,

so i have seen your last Public-Update has this feature and it's functioned very very well, when i put doublequotes around [HREF] and use the option, the whole Path will be delivered with a double quote surround. Great.

Now i must write again my cmd-scripts and iam happy.

thx