AHK V2: Need different pairs of quotes in Run()? Topic is solved

Get help with using AutoHotkey (v2 or newer) and its commands and hotkeys
SAbboushi
Posts: 252
Joined: 08 Dec 2014, 22:13

AHK V2: Need different pairs of quotes in Run()?

24 Jun 2018, 20:07

The two ways I've found that work as an expression for Run():

Code: Select all

Run('"J:\StandaloneApps\AutoHotkey - 2018_05_17 v1\AutoHotkeyU64.exe" "2018_06_24 Run command, passing parameters (2 of 2).ahk" "QIE"')

Code: Select all

	AppExe 		:= '"J:\StandaloneApps\AutoHotkey - 2018_05_17 v1\AutoHotkeyU64.exe"'
	AppDoc 		:= '"2018_06_24 Run command, passing parameters (2 of 2).ahk"'
	AppParams 	:= '"QIE"'
	Run(AppExe ' ' AppDoc " " AppParams)
1) Wondering why the second example requires different pairs of quotes between the variables in order to work? I find it can either be

Code: Select all

Run(AppExe ' ' AppDoc " " AppParams)
or

Code: Select all

Run(AppExe " " AppDoc ' ' AppParams)
2) Is there another way to do this?
swagfag
Posts: 6222
Joined: 11 Jan 2017, 17:59

Re: AHK V2: Need different pairs of quotes in Run()?

24 Jun 2018, 20:31

different way:

Code: Select all

Run("
(Join`s
	"J:\StandaloneApps\AutoHotkey - 2018_05_17 v1\AutoHotkeyU64.exe"
	"2018_06_24 Run command, passing parameters (2 of 2).ahk"
	"QIE"
)")
User avatar
Flipeador
Posts: 1204
Joined: 15 Nov 2014, 21:31
Location: Argentina
Contact:

Re: AHK V2: Need different pairs of quotes in Run()?

24 Jun 2018, 20:44

Wondering why the second example requires different pairs of quotes between the variables in order to work?
I'm not sure what you mean. It also works with the same pairs of quotes.
Is there another way to do this?

Code: Select all

MsgBox "`"J:\StandaloneApps\AutoHotkey - 2018_05_17 v1\AutoHotkeyU64.exe`" `"2018_06_24 Run command, passing parameters (2 of 2).ahk`" `"QIE`""
;)
iseahound
Posts: 1445
Joined: 13 Aug 2016, 21:04
Contact:

Re: AHK V2: Need different pairs of quotes in Run()?

24 Jun 2018, 23:50

Code: Select all

static q := Chr(0x22)

Code: Select all

Run(q "J:\StandaloneApps\AutoHotkey - 2018_05_17 v1\AutoHotkeyU64.exe" q A_Space q "2018_06_24 Run command, passing parameters (2 of 2).ahk" q " " q "QIE" q)
lexikos
Posts: 9592
Joined: 30 Sep 2013, 04:07
Contact:

Re: AHK V2: Need different pairs of quotes in Run()?  Topic is solved

25 Jun 2018, 02:59

One key to better understanding is to observe the difference between what you physically write into the file, and what the function receives.

Code: Select all

	AppExe 		:= '"J:\StandaloneApps\AutoHotkey - 2018_05_17 v1\AutoHotkeyU64.exe"'
	AppDoc 		:= '"2018_06_24 Run command, passing parameters (2 of 2).ahk"'
	AppParams 	:= '"QIE"'
	MsgBox(AppExe ' ' AppDoc " " AppParams)
If you run this, you will see that there is only one type of quote mark being received by the function.

Return to “Ask for Help (v2)”

Who is online

Users browsing this forum: No registered users and 58 guests