🅰️HK Lesson #14: How to create your own functions with 🅰️utoHotkey!

Hello,

If you’ve watched many of my videos you’ll know that I think Functions are the absolute best way to quickly level-up.  The email that preceded this one discussed how you can use built-in AutoHotkey Functions.

This email will touch on creating your own functions! 

I like to refer to functions as “go-subs on crack” (ha ha).

I say this because you can think of them as a go-sub / subroutine (where you jump to a specific spot of code and return back when done) however, because you can pass one or more parameters (text, variables, objects, etc.) to your function, they make them extremely more powerful than a subroutine.

There are a few very important things to realize when using functions:

  • You must define a custom function in addition to “call it” when you want to use it
  • When working with functions “scope” refers to the visibility of variables within the function
  • You can, but do not have to, pass parameters to a function
  • You can return one “thing” from a function (but don’t let that turn you off because it is a little misleading)

This is the sort of thing that is easier to grasp in a video.  So check out this video, extracted from Intro to AHK v2 where Isaias walks through the basics of creating and using a function.

How to use functions in AutoHotkey| Level-up today!
How to use functions in AutoHotkey| Level-up today!

Keep in mind we’ve only shared a small fraction of what is in the Intro to AutoHotkey Course.  The course has over 4 hours of content and comes with a double your money back guarantee!  Best of all you can save 15% 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.  We just showed you the tip of the iceberg  in the email above, but we dive deeper in our Intro to Functions, Classes & COM Course. Remember that you get a 15% discount by clicking here❗

Comments are closed.