Page 1 of 1

How to install AutoHotkey_H v2-alpha ?

Posted: 27 Jul 2018, 03:13
by Tobor D
Hello.
Can you explain me how to install AutoHotkey_H v2-alpha?
What i did: deleted old Ahk.
Extract AutoHotkey v2 then extract AutoHotkey_H v2-alpha.

Trying to use example command

Code: Select all

NewThread "MsgBox Message from thread."
And it goes nothing. Just quick error message but instantly disappeared.

I`d add #Persistent in the begining then it shows me error:
"Ambiguous or invalid use of ".
Specifically: .) ..."

I`d check ahk version:
"A_Ahkversion : 2.0-alpha"

Also compile does`nt work although i replace it from ahkdll-v2-release-master\Compiler folder

it work but when i compiling script it gives wrong result.
It must shows ahk version, but it shows just string "A_Ahkversion".

Re: How to install AutoHotkey_H v2-alpha ?

Posted: 27 Jul 2018, 13:46
by swagfag
the example is not tailored to v2 syntax. when you do:

Code: Select all

NewThread "MsgBox Message from thread."
the new script is spawned with the following contents:

Code: Select all

MsgBox Message from thread.
As u can tell, in this context, Message from and thread. are all uninitialized variables and the . is an accessor, lacking its expected property or method, hence the ambiguous use.
what u need to do(at least one way of doing it) is add some quotes and escape them, to make the spawned script v2 syntax compliant:

Code: Select all

NewThread "MsgBox `"Message from thread.`""
that said, command syntax is for the most part discouraged and you'd also need to shove #Persistent somewhere in either your master or slave script to prevent the msgbox from disappearing rightaway

Re: How to install AutoHotkey_H v2-alpha ?

Posted: 27 Jul 2018, 21:56
by Tobor D
swagfag, Thank you very much.
In this case which docs i must follow? I used https://hotkeyit.github.io/v2/docs/AutoHotkey.htm

Re: How to install AutoHotkey_H v2-alpha ?

Posted: 28 Jul 2018, 08:20
by swagfag
for general syntax and ahk usage related queries refer to the ahk_l v2 docs. I use the _H docs solely as a reference for _H functions.
That said if youre gonna be using newly implemented features, its worth checking what degree of parity is kept between releases: https://github.com/HotKeyIt/ahkdll-v2-r ... its/master

Re: How to install AutoHotkey_H v2-alpha ?

Posted: 28 Jul 2018, 09:23
by HotKeyIt
Correct, ahk_h v2 docs are not up to date, use them for ahk_h functions only for the moment as swagfag suggested.

Re: How to install AutoHotkey_H v2-alpha ?

Posted: 28 Jul 2018, 12:44
by Tobor D
HotKeyIt, but what about compile?
Also compile does`nt work although i replace it from ahkdll-v2-release-master\Compiler folder

it works but when i compiling script it gives wrong result.
It must shows ahk version, but it shows just string "A_Ahkversion".

Re: How to install AutoHotkey_H v2-alpha ?  Topic is solved

Posted: 28 Jul 2018, 15:33
by HotKeyIt
Compiling works fine, did you copy v2 AutoHotkey_H.exe to compile folder and renamed it to Ahk2Exe.exe?
Probably this will help: https://autohotkey.com/boards/viewtopic.php?t=50347

Re: How to install AutoHotkey_H v2-alpha ?

Posted: 29 Jul 2018, 13:53
by Tobor D
I'll try thank you