A boilerplate to help jumpstart a script for personal productivity
- Provide easy access to all the features of AutoHotkey
- Understandable structure for future additions
Prerequisite: Install AutoHotkey from ahkscript.org
To get these scripts working on your computer, follow these steps:
-
Install AutoHotKey
You can download it here -
Clone this repo
git clone https://github.com/Ajhad1/AutoHotkeyScripts.git
-
Duplicate the
AutoHotKey.ahk
file to the Documents folder
When AutoHotKey starts up, it looks for a file namedAutoHotKey.ahk
in your Documents folder. So duplicate the file by that name, and point it to where you cloned this repo in Step 2.
AutoHotKeyDir := "C:\Users\ajhad\Documents\GitHub\AutoHotkeyScripts" ; <--- Edit this to point to your path
Run, %A_AhkPath% "%AutoHotKeyDir%\Main.ahk", %AutoHotKeyDir%
- Set AutoHotKey to run at startup
Create a shortcut to AutoHotKey (C:\Program Files\AutoHotkey\AutoHotkey.exe
). Then open the Windows Run utility (Win+R) and typeshell:startup
to open your Startup folder. Then paste the AutoHotKey shortcut in this folder.
- Edit
Settings.ini
as needed - Run
Main.ahk
.
|-- Main.ahk
|-- Settings.ini
|-- Scripts\
| |-- AppSpecific.ahk
| |-- Functions.ahk
| |-- HotStrings.ahk
| `-- Hotkeys.ahk
|-- Lib\
`-- Util\
Universal shortcuts
; Ctrl+Alt+R to reload entire script
^!r::Reload
Auto-expanding Hotstrings are stored here
; Single Line
::btw::by the way
; Multi-Line
::btw::
MsgBox You typed "btw".
Return
Re-usable functions, automatically loaded by Main.ahk
Add(x, y)
{
return x + y
}
This file is organizing application specific shortcut or hotstrings. This is achieved using #If or #IfWin directives
; Control+Click selection in Notepad++ only
#IfWinActive ahk_class Notepad++
^LButton::
Send {LButton 2}
Return
#IfWinActive