• Intro to AutoHotkey HotStrings with AutoHotkey Intermediate AutoHotkey GUIs are Easy with AutoHotkey Intro to DOS & AutoHotkey AutoHotkey FAQ AutoHotkey FAQ

Streamline your code by Utilizing the #Include directive in your AutoHotkey Library

Include directive in AutoHotkeyAs I previously reviewed, functions in AHK rock!  The below video demonstrates how easy it is to use the utilize the include command in AutoHotkey to leverage functions & libraries that are not in your main file.

Without using the include command AHK will first look in your local library, then look under the myDocuments\AutoHotkey\Lib\ folder and finally under path-to-running-AutoHotkey.exe\lib\.

 

Three lib folder paths

 

 

 

 

 

By using the #Include Directive you specifically tell AHK to “include” the file in your script.

Using the Include Directive in AutoHotkey

 

AutoHotkey Webinar: 9/20/2016 Using Functions and DLL call in AutoHotkey

AutoHotkey webinarAutoHotkey Webinar Videos and LinksBlack Bottle2

Link to AutoHotkey Webinar resources:

Additional resources mentioned in AutoHotkey Webinar

Using built-in Functions

SubStr(String, StartingPos [, Length])

Trim()

Round(Number[,N])

AutoHotkey Bottle 4Creating your own custom function

  • Why you want to create them
  • Things to pay attention to:
    • Accessing variables outside your function
    • Passing parameters
    • Setting defaults
    • Returning values

DLL call

  • What is it?
  • Why is it so valuable an Asset?
  • Why is it so ‘tricky’?
  • Message Box
 
v:= DllCall("MessageBox","Uint",0,"Str","my message","Str","my title","Uint","0x00000036L")

 

Additional DLLCall Resources

Script Highlight- Pasting plain text

#SingleInstance Force
^g:: ;Control G pastes plain text
Store:=ClipboardAll ;Store full version of clipboard
ClipBoard := ClipBoard ; Convert to plain text
Sleep, 50
SendInput, ^v ;paste plain text
Sleep, 50
Clipboard:=Store ;restore clipboard to original content
return

AutoHotkey Bottle 1

Register for upcoming AutoHotkey webinars here