In the v2 docs it still says the following:
I was seriously hoping that this would at least be fixed in v2.Script Parameters: The string(s) you want to pass into the script, with each separated from the next by a space. Any parameter that contains spaces should be enclosed in quotation marks. A literal quotation mark may be passed in by preceding it with a backslash (\"). Consequently, any trailing slash in a quoted parameter (such as "C:\My Documents\") is treated as a literal quotation mark (that is, the script would receive the string C:\My Documents"). To remove such quotes, use A_Args[1] := StrReplace(A_Args[1], '"')
Source: https://lexikos.github.io/v2/docs/Scripts.htm#cmd
The fact that a literal quotation mark can be passed in by preceding it with a backslash is just stupid to say it in simple terms.
To use less simple terms:
If one parameter is a quoted file path and is passed with a trailing backslash, and is followed by other parameters afterwards, it just messes up the command line parameters, no matter what. StrReplace(A_Args[1], '"') does not help.
For one thing, the quoted trail-backslashed parameter and the parameter following it are both always seen as one incoming parameter. Whether or not further following parameters are also appended to that first parameter and how much more everything gets messed up depends on whether the following parameters are also quoted and also trail-backslashed.
This way it is really ugly to write a script for maybe the broad general public with, let's say, a variable number of file paths as incoming command line parameters. Even with a fixed number it is ugly. The broad general public will think that I as the programmer am stupid or lazy because I can't or won't allow trailing backslashes in the command line parameters.
The simple solution would be:
If you, the devs, would change ahk to not allow escaping literal quotation marks with a backslash. Use something else that at least can't be part of a file path. Or, afaik the double quotation mark "" already works to mean one literal quotation mark. I think that is enough.
Thanks. Regards, S.