Tutorial for Newbies
As a person who started using AHK having absolutely zero programming experience (never taken a class or read a book on computers in my life), I will give you my 2 cents on learning it.
I think exploring the forum works great if you have even a little bit of background in this area. If, like me, you have none, I would learn it in the following order (this is how I would do it if I had to do it over again). My reasoning here is that for a person starting from scratch, you need to learn concepts before learning commands, and the forum is geared more towards commands.
- First read the Tutorial, the Scripts page, and then the FAQ. Afterwards, I would recommend learning concepts in the following order:Hotstrings
- Hotkeys
- Mouse Clicks & Mouse HotKeys
- Variables
- Expressions
- Loops - especially Parsing Loops
- Strings - (e.g. StringMid, StringReplace)
- If,Else statements
- Arrays & Dynamic variables - (StringSplit)
- GoSub & Functions
- GUIs
- Windows Messages
- DllCallThe first 3 you will not necessarily use very often once you become proficient with the program; but they are the easiest to comprehend and implement. Everything from Variables through GUIs is what I would consider the "core" of the program that you will use repeatedly to write virtually all of your scripts with. Windows Messages and DLLCalls are the advanced techniques that are the most powerful but most complicated. The average user will probably never have the need and desire to master these two.
Of course this list is not set in stone, and you may be learning multiple items at once (for example you may want to scratch the surface of GUIs right away), but I think all of the items are important to learn about if you plan to use AHK more than a few times, and I tried to arrange them in an order that would be most logical and systematic.
When you're wondering how to accomplish a specific task in AHK, remember that most of the commands have a common naming scheme to identify what they do. For example:
Commands dealing with files start with File.
Commands dealing with windows start with Win.
Commands dealing with text start with String.
Similarly:
Commands that retrieve data from somewhere contain Get.
Commands that apply data to somewhere contain Set.
Combining the two previous structures, we have commands like:
FileGetSize - Retrieve the size of a file.
WinGetTitle - Retrieve the title of a window.
StringGetPos - Retrieve the position of a piece of text inside a larger piece (like a sentence in a paragraph).
FileSetTime - Apply a new Time Stamp to a file.
WinSetTitle - Apply a new title to a window.
SetTimer - Apply a new Timer, which is a command or group of commands that run at timed intervals.
Good Luck, and remember that nobody was born knowing any of this. It takes time.