Escape commas in a keyword argument type

Good day

Suppose that in a script command, a keyword type argument receives a value that contains a comma, among several other values. How can I tell which comma needs to be escaped?

When passing a list of values to an argument in the script's code, you can use quotes to specify that a comma isn't a separator, but the same doesn't seem to work when using it directly in an instruction.

For example:

MYCOMMAND ARG="one,two",three

will be passed as one,two,three. So you can't tell which means a separator and which is a literal comma.


Kind of an off-topic/feature request, but it would definitely be a nice improvement if keyword type arguments also returned a Vector instead of a string, to make parsing them easier.

To avoid breaking compatibility, perhaps a new argument type would make sense? Or maybe if you use /K/M, it could allow arguments to be passed as ARG="one,two",three..., where , is used as the separator instead of a space (which IMO feels more natural in the command). Quotes would still indicate that something is a single value, and in the script, instead of returning a string, it would return a Vector, like /M currently does.

Commas don't mean anything specific to the command parser, a /K argument will return a string containing commas just fine. If your script wants to handle comma separated keywords it needs to handle splitting them up from the single string that Opus will provide.

If your problem is that you want to be able to include literal quotes in the argument, this should work:

MYCOMMAND ARG="""one,two"",three"