Search code examples
autohotkey

Autohotkey: How to use nested double quotes on a run statement in ahk script


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.


Solution

  • 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/"