AutoIt vs AutoHotkey

Discuss other programming languages besides AutoHotkey
Autosofted
Posts: 2
Joined: 31 Dec 2020, 21:53

AutoIt vs AutoHotkey

Post by Autosofted » 01 Jan 2021, 21:35

Hello all,

I was wondering if there are any notable differences between between AutoIt and AutoHotkey. Maybe there are some of you on here who have used both and can provide some input. Perhaps the syntax is easier to read on one over the other? (That might just be a preference thing though). Also, the AutoIt community can be a bit strict on what we can discuss, maybe this community is more open and friendly? Maybe AHK can do more complex stuff? etc...

I've been an AutoIt user for most of my years and it's actually the only language I know. However with the type of programs that I create (mainly file automation & macros), I hear AutoHotkey might be the better language for that.

Thank you in advance.

SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: AutoIt vs AutoHotkey

Post by SOTE » 02 Jan 2021, 07:52

This is a bit of a touchy subject, even though this is considered the more open and friendly forum. Partially because such a topic seems to attract or activate infrequently used accounts that will then go in on AutoHotkey pretty hard. Nevertheless, people have a right to their beliefs and to compare, so will give my observations.

1) The AHK forum is usually friendlier and more responsive to newbies and casuals.

2) AHK is better at Hotkeys, as the name suggests.

An important point that is closely aligned to this is Hotkey Labels, and then Labels in general. The combination makes it very easy for newbies and casuals to create programs right away, since the Labels can easily correspond to simple and then increasingly complex subroutines or later be replaced by functions.

3) AHK is easier to understand and use for non-programmers and casuals.

I originally used WinBatch and then AutoIt. In those days, WinBatch was expensive, so decided to try out free alternatives. I then came upon AutoIt and AutoHotkey, and compared them directly in various use cases. Again and again, I found AutoHotkey just easier to use for the tasks that were needed to be accomplished. In addition, and especially in more recent years, AutoHotkey's list of features have made it as equally or arguably more powerful than its competitors.

The claim about ease of use gets a bit controversial, in the sense that AutoHotkey's syntax is accused of being eccentric or non-standard by opposing sides. Often chief among these accusations are the use of := vs =, = vs ==, %% (Var = %Var2%), etc... At points that such can be argued, AutoHotkey's documentation does a good job at explanation and so do volunteers on the forum, thus this is mostly neutralized. It should be noted that arguably all programming languages have their "eccentricities", ways of doing things that some find logically questionable, or things that are unique to a particular language. AutoIt included...

In the case of AutoHotkey, part of this so-called controversy is that it preserves a Windows Batch Scripting heritage, thus allows for %%. This should not be really so controversial, as AutoHotkey is used for the Windows OS and users will make use of the command line, or .bat and .cmd files at times. In addition, other programming languages use ":=" for assignment or "=" for equality, among them Object Pascal/Delphi, Go (Golang), Smalltalk... And now Python has adopted ":=" too. Part of this "confusion" is arguably coming from being stuck in how BASIC/Visual Basic is doing things. Because AutoIt went down the path of copying BASIC/Visual Basic, doesn't mean that AutoHotkey must too. It might be that people have already used BASIC/Visual Basic so find AutoIt easier to transition to, but this would not be the case for newbies and causals that have never done any programming. In those cases, they probably will find AutoHotkey easier.

4) AHK GUI syntax is easier to use

I want to focus on this in particular, because it was one of my deciding factors years ago of choosing AutoHotkey over AutoIt. It was just plain easier to make GUIs for command line applications with AutoHotkey.

5) ImageSearch

AutoHotkey has ImageSearch built in, providing greater convenience and capability of the interpreter. I bring this up, as I have read a number of complaints (from years ago and maybe still today) by AutoIt users as to why this isn't so with their software. Among the odd push back in AutoIt circles for not integrating this capability into the interpreter as oppose to finding a UDF, is that ImageSearch is something Gamers like and isn't for "real" automation. This then goes into a bit of what appears to be AutoIt weirdness. Using image search capabilities is very much about automation and is well known in RDA/RPA circles and applications. Note- More RDA/RPA applications integrate AutoHotkey use, as oppose to AutoIt. At the point that the interpreter can't recognize specific controls, especially with non-standard windows, then the use of image search is a good fall back/plan B. In addition to ImageSearch, AutoHotkey has various GDI+/Gdip and OCR based scripts as well.

6) OOP & Objects

I think that AutoHotkey being a Prototype-based OOP language and what that means, is something that flys under the radar. In addition, Objects are thoroughly integrated into AutoHotkey in numerous ways, while it's not with AutoIt. In the case of AutoIt, it is forced to use various UDFs for OOP.

In AutoHotkey, you can do Class-based OOP (though I don't care for this much, but others do), or you can create simpler data-only or function-only Objects. Even better about these AutoHotkey Objects is that they can be put together by composition. Meaning you can add or remove data or functions to Objects (without using a Class) at will. This adds enormous capabilities to AutoHotkey scripts, that is easy to use.

For those that don't know what Prototype-based OOP is all about, you might want to check the documentation and this Wiki- https://en.wikipedia.org/wiki/Prototype-based_programming

7) AHK plays well with JavaScript and other C family languages

Because JavaScript is another Prototype-based language and also of the C syntax family, one will find a lot of synergy between it and AutoHotkey. AutoHotkey Objects can easily be converted to JSON, and back again. The mixing or transition to using JavaScript from AutoHotkey is arguably much easier than if coming from AutoIt or BASIC syntax. The fact of the matter is that C family languages dominate. For advanced AHK coders, looking at other C family languages or source code would be arguably more comfortable.

8) AHK is open-source

This something to not be taken lightly, as has greater value for security. It means advanced AHK coders can inspect and make sure there aren't any back doors or dangerous bugs. In addition, they can also modify the source code as needed.

9) AHK has more presence on Rosetta Code and example code

This one is more debatable, but from my web searches, it's often much easier to find examples of AutoHotkey code being used to solve a task than with AutoIt. And code on Rosseta Stone is no minor thing. It's AutoHotkey compared head to head with other programming languages.
https://rosettacode.org/wiki/Category:AutoHotkey (Rosetta Code AutoHotkey)

10) AHK supports more languages; documentation and on web site.

If a person only speaks English, that might not be such a big thing to them, but the world is a big place with many other languages. It's a credit to AutoHotkey that it embraces a more international view point and provides more support for other languages.
Last edited by SOTE on 24 Jan 2021, 15:25, edited 1 time in total.

Autosofted
Posts: 2
Joined: 31 Dec 2020, 21:53

Re: AutoIt vs AutoHotkey

Post by Autosofted » 03 Jan 2021, 23:02

Thank you for writing such a detailed response SOTE! It sounds like overall AHK is simpler to use and more user-friendly. I do struggle with creating GUI's in AutoIt which led me to believe that GUI creation in general might just be difficult, but maybe it was the language that was the barrier. I think automation in general should cover a wide blanket of fields, AutoIt wants to ignore the gamer field though, which doesn't sit well with a lot of people. I also have to include way too many UDF's for a simple program in AutoIt, sounds like AHK solves that with it's class based OOP. I also know that AutoIt doesn't have ImageSearch built in but I also know that they (AutoIt) are at least developing their GDI library to include more stuff (for lack of a better word).

I know AutoIt works better with Basic while AHK works better with C, there are currently more users programming with the C family of language so that is a plus for AHK. I'm not sure about how AutoIt mingles with Javascript. I did not know AHK was open source, this is a huge plus to security concerns, I wonder why AutoIt doesn't do the same. Looks like there are more forks and variants of AHK than AutoIt and I'm sure there's a good reason for that. So overall, I think I'll start learning AutoHotkey and see where it takes me. Thanks again!

SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: AutoIt vs AutoHotkey

Post by SOTE » 05 Jan 2021, 08:53

Autosofted wrote:
03 Jan 2021, 23:02
Thank you for writing such a detailed response SOTE! It sounds like overall AHK is simpler to use and more user-friendly...
...So overall, I think I'll start learning AutoHotkey and see where it takes me. Thanks again!
You are welcome. And, welcome aboard to the AHK community. :dance:

malcev
Posts: 1769
Joined: 12 Aug 2014, 12:37

Re: AutoIt vs AutoHotkey

Post by malcev » 07 Jan 2021, 16:13

It depends on what You need.
Autoit has some complex UDF, that Autohotkey does not have, or even if Ahk has them, they are not popular and therefore not finished or have bugs.
For example IUIAutomation:
https://www.autoitscript.com/forum/topic/153520-iuiautomation-ms-framework-automate-chrome-ff-ie/

burque505
Posts: 1731
Joined: 22 Jan 2017, 19:37

Re: AutoIt vs AutoHotkey

Post by burque505 » 09 Jan 2021, 08:31

@malcev, your example is very good. That is a very active thread in the AutoIt forum. Also, user 'junkew' who created it has been active on that thread for 7 years at least.
I have been using SimpleSpy to help with IUIAutomation for quite a while now. SimpleSpy even generates code that (if it can't be used verbatim) can be easily modified.
Regards,
burque505

SOTE
Posts: 1426
Joined: 15 Jun 2015, 06:21

Re: AutoIt vs AutoHotkey

Post by SOTE » 09 Jan 2021, 11:06

malcev wrote:
07 Jan 2021, 16:13
It depends on what You need.
I'm not saying that in absolute terms, one is better than the other in every way. All programming languages and communities develop and evolve differently, so have various advantages and disadvantages. WinBatch and AutoIt are automation languages that have existed for longer than AHK and have various things to offer. The AHK community can evaluate and port over some of those UDFs (also called that in WinBatch) as they see fit. It's often easier to look at a more similar automation language first, before expanding the search. And let's us make no mistake about it, WinBatch and AutoIt scripters get ideas from, borrow, and use code from other programming languages as well (to include AHK). In fact, AutoIt's ImageSearch UDF/DLL, appears to have been originally from AutoHotkey's source code (https://www.autoitscript.com/forum/topic/65748-image-search-library), back in 2008. If a person has a problem that needs a solution, definitely they should be open-minded about it. To include casting a wide net and looking at a variety of programming languages to see what they have or how they do things.

However, I will add that being or becoming a polyglot programmer, is not something so easily done. Usually, to get to such a point, the person has crossed over from casual or hobby programmer to advanced or even professional level programmer. So in that context, such people are often tackling complex programming problems or can have much more sophisticated requirements than those of ordinary users, casuals, or hobbyist.

Post Reply

Return to “Other Programming Languages”