AHK 2.0 Question

Get help with using AutoHotkey and its commands and hotkeys
MaxAstro
Posts: 557
Joined: 05 Oct 2016, 13:00

AHK 2.0 Question

01 Jun 2018, 09:49

I have a fairly large script that I use day-to-day, consisting of a dozen or so files and thousands of lines of code, all written in AHK1. I've heard AHK2 mentioned a few times, but never in great detail. How complicated is it to port a script from AHK1 to AHK2? What are the advantages of doing so? What can AHK2 do that AHK1 cant? Also, does Scite4AHK support 2.0?
User avatar
Flipeador
Posts: 1196
Joined: 15 Nov 2014, 21:31
GitHub: Flipeador
Location: Argentina
Contact:

Re: AHK 2.0 Question

01 Jun 2018, 10:19

How complicated is it to port a script from AHK1 to AHK2
Read AutoHotkey v2, Changes from v1.1 to v2.0.
You need (you should) rewrite all of them from scratch (i don't recommend any "translator"), but not before reading exhaustively all the documentation and follow forum AutoHotkey v2 Development.
What are the advantages of doing so? What can AHK2 do that AHK1 cant?
Well, I think there's a small improvement in performance (in addition to new features), especially in the processing of messages (events). I read in the forum a topic where there were certain issues in AHKv1 that in AHKv2 were solved regarding certain events. I do not remember the topic in question.
In addition, AHKv2 keeps you away from some bad programming practices.
Also, does Scite4AHK support 2.0?
I do not know, I do not use Scite4AHK, I think it had a syntax, but I doubt it was updated. I had to make my own syntax for SublimeText.

:wave:
Edit: As Helgef said, AHKv2 is much clearer, more comfortable and easier to work on long projects. The code is definitely more enjoyable.
Windws 1♂ Pro 64-Bits I make scripts for AHKv2 & WIN_7+ Argentina
Helgef
Posts: 4479
Joined: 17 Jul 2016, 01:02
Contact:

Re: AHK 2.0 Question

01 Jun 2018, 10:41

I wouldn't recommend converting a working v1 script, unless there is still a lot of development left on the project. V2 is much easier to work with, but converting a working script will not necessarily mean the result will be (much) better. Regarding scite, see this (I didn't try it myself (yet)).

Cheers.

Return to “Ask For Help”

Who is online

Users browsing this forum: Bing [Bot], djuga, manehscripts, Spawnova and 30 guests