🅰️HK Lesson #13: How to use Commands, Functions and Directives

Hello,

AutoHotkey is a fairly simple language. When you’re writing AutoHotkey code you’re using one of there types: Commands, Functions, and Directives.

Commands and Functions both use the same method and differ slightly. Here are links to the built-in v2 functions.

In this video Isaias discusses the basics of built-in functions in AutoHotkey v2.

Using built-in Commands and Built in AHK v2
Using built-in Commands and Built in AHK v2

We also have this great script which allows you to list all the built-in functions (and shows the values they have)

Directives are better thought of as “settings” for your script and are often set once per script (often at the beginning). Directives are easy to identify because they begin with #. #SingleInstance is an example that we covered earlier in this email series.

BTW one of my favorite “level-ups” in programming is to teach people how they can create their own functions (which is the topic of the next email😊.) BTW You can learn more about Functions, Commands and Directives in our Intro to AutoHotkeycourse. Don’t forget you can save 15% on the course by clicking here.

Additional Resources

Joe, Isaias, Irfan & Team

the-Automator.com

This campaign was designed to allow you to jump around.  At any time you can jump to any one of the emails by clicking below

1) Intro2) AHK Versions3) Editors4) First AHK Script5) Getting Help
6) Variables7) Run @ Startup8) Downloading Viruses9) HotStrings10) Hotkeys
11) One vs Many Scripts12) Intro to QAP13) Functions & Directives14) Custom Functions15) Includes & Lib
16) Troubleshooting17) Intro to GUIs18) Using Clipboard19) Reading Files20) Saving Preferences
21) Automating older Progs22) Automating Menus

P.S. If you want to learn more about Functions, Objects or Classes, we recommend you taking a look at our Intro to Functions, Classes & COM.

Comments are closed.