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

Get help with using AutoHotkey and its commands and hotkeys
SAbboushi
Posts: 145
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: 1984
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: 1044
Joined: 15 Nov 2014, 21:31
GitHub: Flipeador
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`""
;)
Windws 1♂ Pro 64-Bits I make scripts for AHKv2 (my v2 compiler) & WIN_7+ Spanish Argentina
(If any of my code written for v2 has stopped working, send me a private message. I appreciate that you correct my English.)
iseahound
Posts: 369
Joined: 13 Aug 2016, 21:04
GitHub: iseahound

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: 6207
Joined: 30 Sep 2013, 04:07
GitHub: Lexikos

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.
SAbboushi
Posts: 145
Joined: 08 Dec 2014, 22:13

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

25 Jun 2018, 10:58

Thanks folks - I'm clear now!

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], paik1002, woshichuanqilz72 and 130 guests