What do you use AHK for?

Discuss Autohotkey related topics here. Not a place to share code.
Forum rules
Discuss Autohotkey related topics here. Not a place to share code.
PainFoinmr
Posts: 2
Joined: 14 Sep 2020, 08:51

What do you use AHK for?

14 Sep 2020, 09:00

Hello!

I recently got a very mundane task at work that had me repeat ctrl+c, ctrl+v and 2 clicks 700 times. I knew you could get some programs that mimic your inputs back when I still played MMOs lol. So anyway, I got some bad quality programs that ended their free trials after a few hundred actions. Then I stumbled upon AHK. It took me about an hour of tutorial and about another hour of trial and error and some googling to completely automatize this particular task. Now, I'm no programmer but I have done some basic coding back in school and for this particular job I also created a web-scraper in Python which is probably my biggest achievement.
Now my question is, what kind of projects is AHK better for than learning more advanced coding languages like Python? I can definitely see myself using AHK for more tasks because it is easy to use, it doens't have tons of libraries and it doens't have complicated syntax. However, I do feel like Python experience would definitely look better on my resume and would eventually be much more better for my personal use if I learned to program with it.
User avatar
boiler
Posts: 6631
Joined: 21 Dec 2014, 02:44

Re: What do you use AHK for?

14 Sep 2020, 10:02

PainFoinmr wrote:
14 Sep 2020, 09:00

Now my question is, what kind of projects is AHK better for than learning more advanced coding languages like Python? I can definitely see myself using AHK for more tasks because it is easy to use, it doens't have tons of libraries and it doens't have complicated syntax. However, I do feel like Python experience would definitely look better on my resume and would eventually be much more better for my personal use if I learned to program with it.
Python is of course more popular and better for your resume than AHK, but what would cause you to characterize it as “more advanced” than AHK?
SOTE
Posts: 1193
Joined: 15 Jun 2015, 06:21

Re: What do you use AHK for?

15 Sep 2020, 01:40

PainFoinmr , I get the impression that you are approaching it as if it must be one or the other, when instead the answer could be use both. In my opinion, when it comes to automation scripting on Windows, AutoHotkey is the clear choice. If instead you are talking about cross-platform general programming, then that's where Python will shine. Though do keep in mind there is a soon to come dark horse in Keysharp (https://www.autohotkey.com/boards/viewtopic.php?f=80&t=77248), that can bring AuotHotkey style cross-platform automation scripting into the conversation. So in that context, it might be more appropriate to compare AutoHotkey (including forks and variants), with PyAutoGUI.

Though it's just my opinion, as a general programming language, there are arguably better choices than Python depending on the situation and what you want to do. It could be that JavaScript, Object Pascal, C#, C, C++, Go, Pharo, etc... are the better option. If you are talking about professional RPA/RDA, which would be more aligned to doing automation, then there is UiPath, Automation Anywhere, OpenRPA, etc... AutoHotkey can be integrated with both UiPath and OpenRPA projects. Thought not originally designed for the enterprise level, people might want to have a look at Pulover's Macro Creator https://www.autohotkey.com/boards/viewtopic.php?f=63&t=143, in terms of something in the RDA arena and purely in AutoHotkey.

So while Python will definitely look good on a resume, if you are just talking about that angle, its not the only thing that you could put on your resume, make a living from, or use in a business. Outside of a professional software developer context, AutoHotkey is a good Windows OS general purpose programming language for hobbyists or to be used within a business like for an IT department, school, job productivity enhancer, utility app, etc...
PainFoinmr
Posts: 2
Joined: 14 Sep 2020, 08:51

Re: What do you use AHK for?

15 Sep 2020, 04:18

boiler wrote:
14 Sep 2020, 10:02
but what would cause you to characterize it as “more advanced” than AHK?
My opinion is based on first impressions. Python has a lot of libraries like the example I used for web-scraper. It took me way longer to figure out than AHK, but the libraries really helped me get done what I needed. While for AHK - it just seems for smaller and more hobby projects. That's why I asked - what do people use it for.
SOTE wrote: PainFoinmr , I get the impression that you are approaching it as if it must be one or the other, when instead the answer could be use both. In my opinion, when it comes to automation scripting on Windows, AutoHotkey is the clear choice. If instead you are talking about cross-platform general programming, then that's where Python will shine. Though do keep in mind there is a soon to come dark horse in Keysharp (https://www.autohotkey.com/boards/viewtopic.php?f=80&t=77248), that can bring AuotHotkey style cross-platform automation scripting into the conversation. So in that context, it might be more appropriate to compare AutoHotkey (including forks and variants), with PyAutoGUI.

Though it's just my opinion, as a general programming language, there are arguably better choices than Python depending on the situation and what you want to do. It could be that JavaScript, Object Pascal, C#, C, C++, Go, Pharo, etc... are the better option. If you are talking about professional RPA/RDA, which would be more aligned to doing automation, then there is UiPath, Automation Anywhere, OpenRPA, etc... AutoHotkey can be integrated with both UiPath and OpenRPA projects.
This is nice to hear. I do admit that AHK is very easy to use and very convenient and I am tempted to stick with it for my 'ctrl+c, ctrl+v, click' tasks in my current job.
But same question goes for you: what do you use AHK for and it looks like you are much more experienced with programming and automatization than I am. So what strengths do you see in AHK?
SOTE
Posts: 1193
Joined: 15 Jun 2015, 06:21

Re: What do you use AHK for?

15 Sep 2020, 05:49

PainFoinmr wrote:
15 Sep 2020, 04:18
This is nice to hear. I do admit that AHK is very easy to use and very convenient and I am tempted to stick with it for my 'ctrl+c, ctrl+v, click' tasks in my current job.
But same question goes for you: what do you use AHK for and it looks like you are much more experienced with programming and automatization than I am. So what strengths do you see in AHK?
The strengths are as I mentioned, automation scripting (it's original purpose), and then general purpose programming on the Windows OS. As AutoHotkey is simple to understand and has a small footprint, it's quite easy to write utility type programs in, and with no more than just notepad versus some monstrosity like Visual Studio.

Utility software also covers a wide range. Clipboard manager, backup programs, system monitoring, OCR, etc... And this is not to dismiss writing all sorts of small applications in AutoHotkey as well, as such programs like Pulover's Macro Creator, AHK Studio, AutoGUI, FindText, etc... demonstrates.

AutoHotkey shines in the context of small automation, utility, and application software because of how quickly one can make them in the language and/or in terms of usefulness. A lot of people are not professional software developers nor want to be, but they can have a problem that requires a software solution. This is where AutoHotkey comes in, because it can empower non software developers, workers, schools, or small businesses on a tight budget.

Examples:

1) You are an IT person managing hundreds of computers. You might want a program that allows users to select, download, and install software that is specific to their department.

Maybe like install, setup Video Conference software, or do an automatic Video Conference connection at a set time, so it's no brainer automatic and as easy as possible for non IT or technically illiterate users.

Note- And there is no way in hell management is going to pay a real software developer or company to do that, but will be happy as a peach if the IT dept does it or to promote the person who can successfully do such tasks.

2) A person is an executive secretary, that needs to pull information out of invoices, match it up to a customer database of emails, and then send out a particular message from the boss to that specific group of customers.

3) Ordinary Joe wants his computer to find the latest news on the election and have the top stories ready prior to his morning cup of coffee.

It's not to say that such would not be possible in other programming languages. But even if the person is a real programmer or knows another language, AutoHotkey can simply be just more fun, smaller, and easier.
User avatar
boiler
Posts: 6631
Joined: 21 Dec 2014, 02:44

Re: What do you use AHK for?

15 Sep 2020, 07:28

PainFoinmr wrote:
15 Sep 2020, 04:18
My opinion is based on first impressions. Python has a lot of libraries like the example I used for web-scraper. It took me way longer to figure out than AHK, but the libraries really helped me get done what I needed. While for AHK - it just seems for smaller and more hobby projects. That's why I asked - what do people use it for.
Python has libraries for web scraping because it doesn’t inherently have the capabilities to do so like AHK does. That makes it less “advanced” in my opinion.

I and others have written commercial software in AHK with sales in the tens of thousands of dollars or more. I and others have had and still have full time jobs automating software (not just websites) and other tasks using AHK because it is the best and most advanced tool for the job. Pretty good for a smaller/hobby project language.
SOTE
Posts: 1193
Joined: 15 Jun 2015, 06:21

Re: What do you use AHK for?

15 Sep 2020, 23:17

Let us also not forget that a lot of Python libraries are really written in C and C++, that then have Python bindings on top. Other programming languages, including AutoHotkey, can pull this trick too (of using C/C++ libraries or dlls). The deeper you go into Python, the more you will be staring at C and C++ code. For example, CPython. It's not to make fun of this, as the same is true for AutoHotkey or JavaScript. I just find it a bit funny when people prop Python up or give the impression that it is "the final solution" when it comes to programming, but it's far from being such. When it comes to interpreted or scripting languages, I think it's more about convenience, situation, and personal preference.
john_c
Posts: 474
Joined: 05 May 2017, 13:19

Re: What do you use AHK for?

24 Sep 2020, 17:18

boiler wrote:
15 Sep 2020, 07:28
I and others have written commercial software in AHK with sales in the tens of thousands of dollars or more. I and others have had and still have full time jobs automating software (not just websites) and other tasks using AHK because it is the best and most advanced tool for the job. Pretty good for a smaller/hobby project language.
You have created AHK programs with sales of $20,000+? This is fascinating. I've never thought it is possible.
User avatar
boiler
Posts: 6631
Joined: 21 Dec 2014, 02:44

Re: What do you use AHK for?

24 Sep 2020, 17:26

Divide that over several years and it’s not that hard to imagine.
ArturNoubel
Posts: 1
Joined: 16 Nov 2020, 06:23

Re: What do you use AHK for?

16 Nov 2020, 07:06

Hello,
Thanks guys for the valuable advice and guidance.
Found a lot of useful information.

ArturNoubel.
SOTE
Posts: 1193
Joined: 15 Jun 2015, 06:21

Re: What do you use AHK for?

16 Nov 2020, 13:29

PainFoinmr wrote:
14 Sep 2020, 09:00
I can definitely see myself using AHK for more tasks because it is easy to use, it doens't have tons of libraries and it doens't have complicated syntax.
One of the great strengths of AutoHotkey, is that it can be used to generate simple or complicated code, relative to what the user can handle or understand. It's very easy to start using AutoHotkey to do the simple, but the language can still be the go to for the very complicated as well.

It's hard to say what the OP's exact meaning is when talking about libraries, but when it comes to utility type libraries that casual programmers, businesses, or IT personnel can come across, AutoHotkey does have a surprising amount of useful libraries and example code. Lxiko's library and class collection alone is at nearly 3,000. This is without mentioning the more helpful than most AHK forum with it's help, scripts, and tutorial sub-forums.

https://github.com/Ixiko/AHK-libs-and-classes-collection
(Ixiko's AHK-libs-and-classes-collection)

https://github.com/Ixiko/AHK-Rare
(A more select collection of AHK libs and functions from lxiko)

https://github.com/ahkscript/awesome-AutoHotkey
(Awesome AutoHotkey collection)
malcev
Posts: 829
Joined: 12 Aug 2014, 12:37

Re: What do you use AHK for?

16 Nov 2020, 14:58

One of the great strengths of AutoHotkey, is that it can be used to generate simple or complicated code
If You need to make something serious and complex, but ahk has no wrapper for that API and You have no much time then I suggest to use python, because it has a lot of ready libraries.
Autohotkey does not have them much.
Therefore You need to read msdn by Yourself, understand api, after that read github c#, c++, python code examples and then try to translate it to ahk.
Sometimes it will be not easy or even impossible because of single-thread.
SOTE
Posts: 1193
Joined: 15 Jun 2015, 06:21

Re: What do you use AHK for?

16 Nov 2020, 16:21

malcev wrote:
16 Nov 2020, 14:58
One of the great strengths of AutoHotkey, is that it can be used to generate simple or complicated code
If You need to make something serious and complex, but ahk has no wrapper for that API and You have no much time then I suggest to use python, because it has a lot of ready libraries. Autohotkey does not have them much...
I partially disagree, because at the level that one is tackling very serious and complex problems with code, they have often crossed over from merely newbie or casual programmer to advanced level programmer and/or are using other programming languages like JavaScript, C/C++, C#, Object Pascal, Go, etc...

An advanced AHK programmer can be adept at "borrowing" from other C family languages, as needed, something we have seen repeatedly on the forum. The jump from AutoHotkey to JavaScript and/or C is relatively very small. Even smaller, if one is an AutoHotkey_H user that is recompiling or customizing the source. An advanced level AHK programmer should be able to look at a lot of C code and figure out what's going on from day 1. Though not as well known of a direction, the jump from AutoHotkey to Object Pascal or Go is a small one too. Once the jump(s) is made, all those libraries and resources of those languages open up. To include making DLLs in those languages to be used with AutoHotkey, using MCode, or using the AutoHotkey.dll in those second or third languages.

In the context of which AutoHotkey (and it's older siblings AutoIt and WinBatch) were made for, bringing automation scripting on Windows to the masses, it is very well suited. One can easily make the argument that AutoHotkey is better suited in that arena than Python.

We should avoid giving the impression that Python is the "go to" alternative solution for everything in programming. Python is an interpreted language, thus can be lacking when compared to compiled languages like C/C++, Object Pascal, etc... And among other things, the deeper you go in Python, the more C and C++ coded libraries will be staring back at you. Nothing is stopping advanced AHK programmers from pilfering/borrowing libraries or translating examples from those languages to AutoHotkey.

Lastly, what other language a person will want to jump to, in order to solve a very serious and complex problem, is a depends type of situation. For example, the correct answer can be JavaScript because it's a web or browser issue. And AutoHotkey and JavaScript can be made to work very well together, depending on the programmer and what they are doing. The answer also could be C/C++, Object Pascal, or Assembly because one is writing code directly interacting with hardware or drivers. So we have to look at each situation, before we can say which other language will be needed to solve difficult issues beyond AutoHotkey's reach.
malcev
Posts: 829
Joined: 12 Aug 2014, 12:37

Re: What do you use AHK for?

16 Nov 2020, 17:20

OK. Let`s make test.
Let`s start from easy task.
Write script that finds all instances of picture that can be any size on screenshot.
Write on ahk. And tell me please for how much time You wrote it.
I will write it on python (even I particulary dont know it) and tell You my time.
SOTE
Posts: 1193
Joined: 15 Jun 2015, 06:21

Re: What do you use AHK for?

16 Nov 2020, 18:02

malcev wrote:
16 Nov 2020, 17:20
OK. Let`s make test.
Let`s start from easy task.
Write script that finds all instances of picture that can be any size on screenshot.
Write on ahk. And tell me please for how much time You wrote it.
I will write it on python (even I particulary dont know it) and tell You my time.
I wasn't responding from the perspective of "me versus you", nor am I interested in being involved in such a contest. The opinion that I presented is about what is arguably good and a probable path for the typical AHK programmer, based on what I've seen and my experiences. A "me versus you" contest would not truly settle it, because it would be relative to each programmer, what they know, their preferences, and possibly their type of work.

If a person likes Python so much, I'm not quite sure why they would be on the AHK forum, when they can be enjoying themselves on the Python forums. There is no metal door holding back AHK coders from becoming Python coders, or from any other programming language.

As for myself, I've played around with Python, in addition to experimenting with several other programming languages. Sorry, but it's "not my cup of tea". I've found JavaScript, Object Pascal, and C far more useful for what I want/wanted to do. But clearly that's just me. A person might choose a different path, like Python or Java, and think that will suit them better. No problem, enjoy walking down that path.
malcev
Posts: 829
Joined: 12 Aug 2014, 12:37

Re: What do you use AHK for?

16 Nov 2020, 18:14

It is not versus me and You.
Also it is not versus Ahk vs Python.
I mean that AHK does not have much API wrappers, or even if it has it - there are no examples of using it.
For example Direct2D, Direct3D, OpenCV, Microsoft Media Foundation and a lot of others API it does not have.
But python has.
Therefore if You dont have time to read all about it and translate it to ahk (iunknown com interfaces in ahk is,,, headache...)- better use python.
For example this topic
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=83224
Ahk does not have bluetooth wrapper.
Therefore Topicstarter has 3 choices.
1) Read msdn, count sizes of structures and write wrapper by himself
2) Use imagesearch popular solution of any problem :)
3) use python library with examples
https://github.com/pybluez/pybluez
SOTE
Posts: 1193
Joined: 15 Jun 2015, 06:21

Re: What do you use AHK for?

16 Nov 2020, 18:56

malcev wrote:
16 Nov 2020, 18:14
It is not versus me and You.
Also it is not versus Ahk vs Python.
I mean that AHK does not have much API wrappers, or even if it has it - there are no examples of using it.
For example Direct2D, Direct3D, OpenCV, Microsoft Media Foundation and a lot of others API it does not have.
But python has.
Therefore if You dont have time to read all about it and translate it to ahk (iunknown com interfaces in ahk is,,, headache...)- better use python.
For example this topic
https://www.autohotkey.com/boards/viewtopic.php?f=76&t=83224
Ahk does not have bluetooth wrapper.
Therefore Topicstarter has 3 choices.
1) Read msdn, count sizes of structures and write wrapper by himself
2) Use imagesearch popular solution of any problem :)
3) use python library with examples
https://github.com/pybluez/pybluez
Direct2D and Direct3D are specifications, and are not specific to any programming language. You can find libraries for using them in many other programming languages.

OpenCV was written in C++, not Python. Other languages have libraries for it, including AutoHotkey and AutoIt.
https://github.com/six1/Laz_OpenCV_2 One fork of several for Object Pascal/Lazarus/Delphi.
https://github.com/manciuszz/AHK-OpenCV OpenCV for AutoHotkey

AutoHotkey is mainly about bringing automation scripting to the Windows OS for the masses, then general purpose programming. As such, it does a great job for typical casual programmer needs, especially anything circling around automation. I would argue that general purpose programming is secondary to what AutoHotkey's original purpose or intention was. Even so, it's easier syntax and ease of use, allowed it to be utilized for many tasks outside of automation. Like building GUI utility apps, games, etc...

If one's purpose is highly advanced and complex coding projects, then almost by definition, you should be an advanced programmer. As such a person, they can choose from many programming languages (not just Python) and in various circumstances adapt AutoHotkey code to solve the task. Case in point is OpenCV for AutoHotkey (above) or AHK SQLite API Wrapper (https://github.com/AHK-just-me/Class_SQLiteDB).

For those that are casual coders, AutoHotkey has a lot of existing libraries and built-in features of the interpreter that they can use, like ImageSearch for example. There is a lot that AutoHotkey has, that many casual coders will never get to it or have need for it, because they are simply not programming to that level.

Instead of trying to have a language that can do everything (of which no such programming language exists), a person is probably better off with something that solves their existing problems as a beginner or newbie. They can worry about the more advanced/complex coding projects later on, as they become that advanced and have a real need. Since AutoHotkey is a C family language, as mentioned, the jump to various other language in that family group will be small. So if they need say JavaScript or C, they can learn it, if that time ever comes. And when they do learn it, they can often integrate it with their AutoHotkey programs in various ways.
malcev
Posts: 829
Joined: 12 Aug 2014, 12:37

Re: What do you use AHK for?

16 Nov 2020, 19:12

OpenCV was written in C++, not Python. Other languages have libraries for it, including AutoHotkey and AutoIt.
https://github.com/manciuszz/AHK-OpenCV OpenCV for AutoHotkey
It is not wrapper. Author took my code and wrap it to class.
But I just translated some examples from autoit to ahk and it was not simple task with structure sending.
On python You dont need to read and understand all of that stuff - just use it.
Direct2D and Direct3D are specifications, and are not specific to any programming language. You can find libraries for using them in many other programming languages.
Try to write something with direct3d in autohotkey and with ready-wrapper in python.
Look at this scripts to understand that it is not easy task.
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=71533
https://www.autohotkey.com/boards/viewtopic.php?t=71142
But as I understand that You are adept of ahk and my arguments have no sense.
SOTE
Posts: 1193
Joined: 15 Jun 2015, 06:21

Re: What do you use AHK for?

17 Nov 2020, 09:41

malcev wrote:
16 Nov 2020, 19:12
On python You dont need to read and understand all of that stuff - just use it.
OpenCV was made with C++. Consequently, any advanced user or group of users can make a wrapper for it. Python users making a wrapper for a C++ library is not something so special that it can't be done in other languages. The issue of OpenCV also emphasizes my previous point, that often one will find that the deeper you go into Python, the more you will see C and C++ code staring back at you. And on that point, it's just as valid to recommend C or C++, as it is to recommend Python.

If an advanced AHK user or group of users are that interested in OpenCV, they can make an AHK wrapper (or better quality one). Even better, they can use Python, AutoIt, or other programming languages as examples. That goes for not just OpenCV, but a long list of C/C++ libraries and code from other programming languages.

Relatively few casual programmers "need" OpenCV. It is massive, and is like a world unto itself, that can take many days to weeks of study. It's a legitimate argument to say that it might be better not to overwhelm newbie or casual programmers, but to provide something light and easy to use. And on those points, as a scripting language, AHK does that very well.
Try to write something with direct3d in autohotkey and with ready-wrapper in python.
Look at this scripts to understand that it is not easy task.
https://www.autohotkey.com/boards/viewtopic.php?f=6&t=71533
https://www.autohotkey.com/boards/viewtopic.php?t=71142
But as I understand that You are adept of ahk and my arguments have no sense.
My argument was never that writing something with Direct3D is trivial. Rather its more a matter of if an advanced AHK programmer(s) wants to deal with it. There are plenty of Direct3D example scripts in AutoIt, which demonstrates it can be clearly done without using Python. If an AHK programmer feels so inclined, they can take a peek at what their AutoIt, Pascal/Delphi, or Visual Basic brothers are doing.

This then brings us to the meat of your argument, where you feel Python is more convenient, as it has more libraries. My counter to that is it depends on what your are looking to do. Just because a programming language has a million libraries, or bindings on top of borrowed C/C++ libraries, doesn't mean the newbie or casual programmer is going to use all of them or is even interested. If what the person wants to do is quite advanced and complex, then they need to be an advanced user that is up to the task. And if they are so advanced in programming, then they will have plenty to choose from beyond Python. If a person is going to "shop around" for programming languages, then Python doesn't have to be the choice. It's just as valid for them to choose Lua, JavaScript, or Pharo depending on their preferences and the tasks.

As for AutoHotkey, my argument is that as a light and easy to use programming language, it's great for casuals. It's a language that will take them a long way into their journey of becoming an advanced coder, or for many, it will be the only language they will ever need.
malcev
Posts: 829
Joined: 12 Aug 2014, 12:37

Re: What do you use AHK for?

17 Nov 2020, 09:57

There are plenty of Direct3D example scripts in AutoIt, which demonstrates it can be clearly done without using Python
Only directx9 version. Lexikos also wrote wrapper for it.
I think You dont understand me.
I told that
If You need to make something serious and complex, but ahk has no wrapper for that API and You have no much time then I suggest to use python, because it has a lot of ready libraries.
I am novice in Python but it took 10 minutes for me to run one of tutorial about using OpenCV.
And it took days for me to understand how to call opencv dll methods.
As for iunkonown - it is more complex calls.
Try by Yourself to create wrapper of iunknown interface and You will understand about what I talk.

Return to “General Discussion”

Who is online

Users browsing this forum: No registered users and 1 guest