AHK_H v2 - Double quotes in arguments

Ask for help, how to use AHK_H, etc.
golpebaixo_
Posts: 2
Joined: 14 Aug 2016, 11:14

AHK_H v2 - Double quotes in arguments

14 Aug 2016, 11:45

So in AHKv2 double quotes are completely removed from strings passed as arguments.
Single quotes can be escaped but not double quotes.

There's a weird issue however. If we add a escaped grave (`) to the beginning of the string all the double quotes will pass through but it works only for the first argument.

If we try the following

Code: Select all

newThread := '
(
	MsgBox(A_Args[1] . " " . A_Args[2])
)'

ExeThread(newThread, '``"STRING1" ``"STRING2"')
Sleep 3000
We get

Image

Which part of that is a bug?
Shouldn't AHK just accept escaped double quotes in arguments as well, just like it accepts single quotes?
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: AHKv2 - Double quotes in arguments

15 Aug 2016, 18:51

That is how CommandLineToArgvW converts the parameters, the first are left because it is assumed to be the executable.
To keep quotes you have to pass 3 of them:

Code: Select all

 newThread := '
(
	MsgBox(A_Args[1] . " " . A_Args[2])
)'
 
ExeThread(newThread, '``"STRING1" ``"""STRING2"""')
Sleep 3000
lexikos
Posts: 9583
Joined: 30 Sep 2013, 04:07
Contact:

Re: AHKv2 - Double quotes in arguments

15 Aug 2016, 19:40

I suppose that the problem is specific to ExeThread, and really has nothing to do with AHKv2.
golpebaixo_
Posts: 2
Joined: 14 Aug 2016, 11:14

Re: AHKv2 - Double quotes in arguments

16 Aug 2016, 02:08

Oh nice, adding 3 of them works fine.
Thanks,
HotKeyIt
Posts: 2364
Joined: 29 Sep 2013, 18:35
Contact:

Re: AHKv2 - Double quotes in arguments

16 Aug 2016, 17:13

lexikos wrote:I suppose that the problem is specific to ExeThread, and really has nothing to do with AHKv2.
ExeThread is only available for AHK_H v2 hence the post in the v2 forum, I have moved the topic to ask for help.

Return to “Ask for Help”

Who is online

Users browsing this forum: No registered users and 24 guests