Starting with AHK-H

Post AHK_H specific scripts & libraries and discuss the usage and development of HotKeyIt's fork/branch
User avatar
hasantr
Posts: 597
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Starting with AHK-H

13 Dec 2019, 12:41

Hello. I like the features of AHK-H. AHK-L I'm new. I want to develop with AHK-H, but I don't know where to start. Which editors can I use? :dance:

I especially use AHK Studio. But it doesn't work with Studio AHK-H.
pneumatic
Posts: 299
Joined: 05 Dec 2016, 01:51

Re: Starting with AHK-H

14 Dec 2019, 10:34

Put the AHK_H executable (x64w\Autohotkey.exe) alongside your .ahk file, then rename it to the same as your .ahk file, then run the executable.

x64w\Autohotkey.exe = 64-bit unicode
Win32w\Autohotkey.exe = 32-bit unicode
x64a\Autohotkey.exe = 64-bit ansi
Win32a\Autohotkey.exe = 32-bit ansi

_MT versions are some kind of portable versions which don't require the AutoHotkey.dll file to be alongside, and also doesn't require user to have installed Visual C++ runtimes from Microsoft. But dll features may not work properly.

I just use Notepad++, so I can't help you with a dedicated editor.
HotKeyIt
Posts: 2144
Joined: 29 Sep 2013, 18:35
Contact:

Re: Starting with AHK-H

14 Dec 2019, 10:43

You can simply replace your AutoHotkey.exe with AHK_H one (backup yours before)
You can use any editor you like.

MT_ version does not require microsoft redistributable.
User avatar
hasantr
Posts: 597
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: Starting with AHK-H

15 Dec 2019, 13:35

I just wanted to run the simple example. But I'm taking errors.

Code: Select all

ahkdll:=AhkThread("Msgbox `% variable:=`"Thread`"") ; Loads the AutoHotkey module and starts the script.
While !ahkdll.ahkgetvar.variable
	Sleep 50 ; wait until variable has been set.
MsgBox % ahkdll.ahkgetvar.variable ; Display content of variable in thread
ahkthread_free(ahkdll),ahkdll:="" ; Stop execution in thread and free resources.
Script Exited, ExitCode: 2
E:\IDELER\AHK-Studio-master\* (6) : ==> The following variable name contains an illegal character:
"Thread"""
swagfag
Posts: 4026
Joined: 11 Jan 2017, 17:59

Re: Starting with AHK-H

15 Dec 2019, 13:47

Code: Select all

; v1
ahkdll:=AhkThread("Msgbox `% variable:=""Thread""") ; Loads the AutoHotkey module and starts the script.
While !ahkdll.ahkgetvar.variable
	Sleep 50 ; wait until variable has been set.
MsgBox % ahkdll.ahkgetvar.variable ; Display content of variable in thread
ahkthread_free(ahkdll),ahkdll:="" ; Stop execution in thread and free resources.
`" is a v2 exclusive way of escaping quoted quotes
User avatar
hasantr
Posts: 597
Joined: 05 Apr 2016, 14:18
Location: İstanbul

Re: Starting with AHK-H

15 Dec 2019, 15:12

swagfag wrote:
15 Dec 2019, 13:47

Code: Select all

; v1
ahkdll:=AhkThread("Msgbox `% variable:=""Thread""") ; Loads the AutoHotkey module and starts the script.
While !ahkdll.ahkgetvar.variable
	Sleep 50 ; wait until variable has been set.
MsgBox % ahkdll.ahkgetvar.variable ; Display content of variable in thread
ahkthread_free(ahkdll),ahkdll:="" ; Stop execution in thread and free resources.
`" is a v2 exclusive way of escaping quoted quotes
I thank you. Can you explain what the while cycle is doing?
swagfag
Posts: 4026
Joined: 11 Jan 2017, 17:59

Re: Starting with AHK-H

15 Dec 2019, 15:38

its explained already?

Code: Select all

; wait until variable has been set.
loop Sleep as long as the thread's ahkgetvar property doesnt contain a property called variable
SOTE
Posts: 1082
Joined: 15 Jun 2015, 06:21

Re: Starting with AHK-H

12 Jan 2020, 13:19

hasantr wrote:
13 Dec 2019, 12:41
Hello. I like the features of AHK-H. AHK-L I'm new. I want to develop with AHK-H, but I don't know where to start. Which editors can I use? :dance:

I especially use AHK Studio. But it doesn't work with Studio AHK-H.
If you are using AHK_H v1, you will find that AHK Studio is quite compatible. This is because AHK_H v1 is a superset of AHK_L v1, and built on top of it. The few problems that I've seen have been:

1) AHK_H help files are not compatible with AHK_L

Meaning you primarily would use/configure for the AHK_L v1 help file, then use the AHK_H v2 file as a supplement (for extra features/keywords). This is because HotKeyIt focuses on updating AHK_H v2 documentation and not AHK_H v1, and only referring to his additional features.

The AHK_H v2 documentation is for both AHK_H v1 and AHK v2, which can be confusing. For greater clarity, it would probably be better (wish list) if HotKeyIt would make this clear, that the present AHK_H help file is referring to additional feature present in both AHK_H v1 and v2. And if syntax is different between his added features/keywords between the versions, he can simply show the distinction in the examples. Thus, there would be a combined AHK_H v1 and v2 help document.

Since AHK Studio is written in AutoHotkey (AHK_L v1), it can be modified by AutoHotkey users to open the AHK_H help file too or you can build a supplemental script that monitors for AHK_H keywords and opens the AHK_H help document when pressing a key of your choice. Like, F1 for AHK_L v1 help and F8 for AHK_H help.

2) Make sure the AHK_H lib folder has all the correct files

If your AHK_H lib folder is missing files, then the user can experience odd errors which causes confusion, when using AHK Studio. In addition, the AHK_H user might have also compiled AHK_H incorrectly or oddly, so are getting unexpected results. However, such problems are not the fault of AHK Studio, but are based on actions taken by the user.

Return to “AutoHotkey_H”

Who is online

Users browsing this forum: No registered users and 1 guest