1
votes

I have a problem. I am running Version v1.1.13.00 of autohotkey. My script works fine, except when I need to run something with double quotes inside other double quotes. I checked the AHKscript forums and all I see is you just use them without any escape characters but this is not working for me.

My hotkey combination is not being held hostage by any other script, program or whatsoever. I can assign it another function and it works.

So far I have tried:

^+h::
run "C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --window-size=300,300 --window-position=200,100 --app=http://hangouts.google.com/"
return

which doesn't work for obvious reasons (space in run string)

^+h::
run ""C:\Program Files (x86)\Google\Chrome\Application\chrome.exe" --window-size=300,300 --window-position=200,100 --app="http://hangouts.google.com/""
return

^+h::
run "`"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe`" --window-size=300,300 --window-position=200,100 --app=`"http://hangouts.google.com/`""
return

The two itterations above, open up the folder where autohotkey is located and stop.

^+h::
run "{"}C:\Program Files (x86)\Google\Chrome\Application\chrome.exe{"} --window-size=300,300 --window-position=200,100 --app=http://hangouts.google.com/"
return

Errors out not liking curly brackets

Oh, by the way run http://hangouts.google.com followed by a winmove, x, y, width, height will not work as my default browser is not chrome but IE and I am not logged into my acct on IE. (separation of of work and personal accts if you will)

At this point, I don't know where to go. If anyone got any idea how to proceed, I am all ears.

1
I might be stupid here, but what's the point of run run ? - phil294
^ that and also you don't need to enclose the entire command line in quotes. Don't forget the primary source of help: documentation, it's very good and has many examples. - wOxxOm
@Blauhirn To do run run, of course. :-) - GregL
there is no need for that, simply use run [program path or name]. Please look up the run command in the documentation - phil294
(1)The run run part was a mistake of copy and pasting. which I fixed in my code section above now. (2)Thanks for the documentation suggestion but I have already looked into that page mentioned and all see is you can stack double quotes one right next to the other, which did not work for me.(3)When there is whitespace character in the path of the command you want to run, it is my understanding that you need to enclose the whole path name in double quotes. If you know a way to overcome that, I'd love to hear that. - MelBurslan

1 Answers

3
votes

Force an expression and use double-quotes to escape double-quotes: ""

run, % """C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"" --window-size=300,300 --window-position=200,100 --app=http://hangouts.google.com/"