Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Tutorial for Newbies


  • Please log in to reply
17 replies to this topic
marlap
  • Members
  • 11 posts
  • Last active: May 27 2008 01:16 AM
  • Joined: 01 Mar 2008
Aside from the quick start tutorial that comes with the standard download of Autohotkey, is there any other literature or other resources to help newbies get started in Autohotkey scripting (programming)? I'm talking real newbies!

trik
  • Members
  • 1317 posts
  • Last active: Jun 11 2010 11:48 PM
  • Joined: 15 Jul 2007
I really didn't use the tutorial, I just looked around on the forums and looked up the commands I saw.

NLI-Conquer
  • Guests
  • Last active:
  • Joined: --
Looking around the scripts and functions is a great way to learn what you need, then you can build yourself up from there.

If you're trying to do something in particular, use the Search tool to find what you're trying to script and examine the scripts source code, look up the commands used if you don't understand them. That should give you a basic idea to be able to "Script it in your own words" if you will.


Hope this helped.

jaco0646
  • Moderators
  • 3165 posts
  • Last active: Apr 01 2014 01:46 AM
  • Joined: 07 Oct 2006
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). :p 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:

1. Hotstrings
2. Hotkeys
3. Mouse Clicks & Mouse HotKeys
4. Variables
5. Loops - especially Parsing Loops
6. String commands - (e.g. StringMid, StringReplace)
7. If,Else statements
8. Expressions
9. Arrays & Dynamic variables - (StringSplit)
10. GoSub & Functions
11. GUIs
12. Windows Messages
13. DllCall

The 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.

memoday
  • Members
  • 17 posts
  • Last active: Aug 16 2008 08:25 AM
  • Joined: 18 Feb 2008

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.


Thanks A Million jaco0646. I have just come across this thread, and I am a newbie too. You have a really smart logical thinking and you explained it in a way that really makes much sense. I like the part about (Set-Get concept). You must be a smart teacher. If not, then you should go ahead and write a book about AHK. I will be the first buyer

Thanks again! :)

marlap
  • Members
  • 11 posts
  • Last active: May 27 2008 01:16 AM
  • Joined: 01 Mar 2008
Thanks all for your time spent in replying to my post. Hopefully, in the future I'll be able to spend time helping others out. Actually, I do have experience on basic programming (back in the Commodore 64 days), so I do know a little about programming structure, but the syntax for this scripting stuff is so different.

DevinChopra
  • Members
  • 4 posts
  • Last active: Jul 09 2008 08:44 AM
  • Joined: 11 Jun 2008
:D jaco0646 Thanx,

I am a total novice at AHK and programming - though I am a webmaster, I could never wrap my head around php and other scripting languages.

But the need of the hour demands it.

I have been trying to make out head and tail of the tutorial and the help file, your post has come as an epiphany!

I think it should be made sticky for newbies like me.

Cheerios,

Devin
Knowledge is more precious than Gold!

mai9
  • Members
  • 63 posts
  • Last active: Aug 15 2011 04:23 PM
  • Joined: 17 Mar 2008
jaco0646, I loved your post aswell, specially the 1-13 steps and the reasoning behind what is core and what is advanced.

BoBo²
  • Guests
  • Last active:
  • Joined: --
@ jaco0646
hi, I've translated your really helpfull post into German. Hope you don't mind to add the following phrase to your initial post:

Der Leitfaden ist ebenfalls in deutscher Sprache verfügbar: [Tutorial für Anfänger]. Viel Erfolg 8)

.. & btw, thanks for your effort, much appreciated! 8)

Razlin
  • Members
  • 454 posts
  • Last active: Feb 05 2014 06:21 PM
  • Joined: 05 Nov 2007
@ jaco0656 Awesome.. here is the french translation.. not 100% but its a start.

Traduction de jaco0646 qui est ici

Comme une personne qui a commencé a utiliser AHK ayant absolument zéro expérience en programmation (jamais prise de classe ou lut de livre sur ordinateurs dans ma vie), Je vous donne mon 2 sous sur mon apprentissage.

Je pense que le forum fonctionne très bien si vous avez un peu de connaissance en programation. Si, comme moi, vous n'avez pas, je recommande d'apprendre dans l'ordre suivante (c'est comment sa que je le ferais si j'avais à le refaire). : P Mon raisonnement ici est que pour une personne qui part de rien, vous devez apprendre concepts avant d'apprendre les commandes , et le forum s'oriente plus sur commandes.

Premièrement lire le Tutoriel, la page des Scripts, puis la FAQ. Ensuite, je recommanderais d'apprendre dans l'ordre suivante:

1. Hotstrings
2. Hotkeys
3. Mouse Clicks & Mouse HotKeys
4. Variables
5. Loops - surtout Parsing Loops
6. String commandes - (p.ex. StringMid, StringReplace)
7. Si, Else déclarations
8. Expressions
9. Arrays & Dynamic variables - (StringSplit)
10. GOSUB & Fonctions [/URL ]
11. GUIs
12. Windows Messages
13. [url=http://www.autohotkey.com/docs/commands/DllCall.htm]DllCall

Les 3 premiers vous utiliserez pas nécessairement souvent lorsque vous devennez proficient avec le language; mais ils sont les plus faciles à comprendre et a appliquer initialement. A partir des Variables jusqu'au GUIs est ce que je considérerais le «noyau» du programme que vous utiliseré le plus souvent pour écrire pratiquement tous vos scripts. Windows Messages et DLLCalls sont des techniques avancées que sont les plus puissantes mais beaucoup plus compliqué. La moyenne des utilisateur auront probablement jamais la nécessité nis le désir pour maîtriser ces deux.
Bien sûr l'ordre peut changé un peut, et vous pouver apprendre plusieurs éléments simultanément (par exemple vous pouver seulement toucher la surface des GUIs toute suite), mais je pense tous les articles sont important à apprendre, si vous avez l'intenssion d'utiliser AHK plus de quelques fois, et j'ai essayé de les organiser en un ordre qui est plus logique et systématique.

Lorsque vous vous demandé comment accomplir une tâche spécifique dans AHK, rappelez que la plupart des commandes sont identifier par ce qu'ils font. Par exemple:

Commandes traitant avec fichiers commence avec file .
Commandes traitant avec fenêtres commence avec Win .
Commandes traitant avec texte commencer avec String .

De Même:

Les commandes pour récupérer les données contiennent Get .
Les commandes pour appliquer les données contiennent Set .

en combinant les deux structures précédentes, nous avons des commandes comme suis:

File Get size - récupérer la taille d'un fichier.
Win Get Titre - récupérer le titre d'une fenêtre.
String Get Pos - récupérer la position de un morceau de texte a l'intérieur d'un plus grand morceau (comme un phrase dans un paragraphe).

File Set Time - Appliquer un nouveau Time Stamp à un fichier.
Win Set Titre - Appliquer une nouveau titre à une fenêtre.
Set Timer - Appliquer un nouveau Timer, qui est une commande ou groupe de commandes qui exécutent à intervalles de votre choix.

Bonne chance , et souvenné vous que personne est né programmeur. Ca prend du temps.



Ok la traduction nes pas a 100% m'est au mois vous pouvé comprendre un peut plus (Je suis au traivail présentement je vais le reviser plus tard pour corriger les fautes

Merci et bonne chance
-=Raz=-

jaco0646
  • Moderators
  • 3165 posts
  • Last active: Apr 01 2014 01:46 AM
  • Joined: 07 Oct 2006
I’ve created a sequence of quizzes based on the material in the AutoHotkey help file and organized in the order of this mini-tutorial. There are around 10 questions for each section, and most of the answers are found directly in the AHK documentation.

These quizzes should cover the important sections of the help file, and hopefully will aid in the learning process by making you think about what you’ve read. Presenting the material in this way might turn on the proverbial light bulb for some people that don’t quite get there by passive reading alone. At least, that’s what I hope.

The following zip file contains each quiz in INI format, along with an AHK script to administer the quizzes (if you don’t want to just read the INIs). The script will give your score at the end of each quiz and allow you to review incorrect answers.

I’ve also added a few of my AHK notes in case anyone finds them useful.

Good Luck!

>DOWNLOAD<

hehe
  • Guests
  • Last active:
  • Joined: --
nice suggestion jaco hehe

BoBo³
  • Guests
  • Last active:
  • Joined: --
That really really cool dude!
A MUST HAVE for noobs :!:

5/5 BoBoStars 8)

jaco0646
  • Moderators
  • 3165 posts
  • Last active: Apr 01 2014 01:46 AM
  • Joined: 07 Oct 2006
:oops: Thanks BoBo.

  • Guests
  • Last active:
  • Joined: --
oh very encouraging jaco I'm also 0 in programming but have many needs and sometimes don't get my problems resolved. nice if I knew how to make my own solution though.