Skip to content

Latest commit

 

History

History
104 lines (72 loc) · 2.51 KB

README.md

File metadata and controls

104 lines (72 loc) · 2.51 KB

AutoHotkey Boilerplate

A boilerplate to help jumpstart a script for personal productivity

Goal

  • Provide easy access to all the features of AutoHotkey
  • Understandable structure for future additions

Installation

Prerequisite: Install AutoHotkey from ahkscript.org

To get these scripts working on your computer, follow these steps:

  1. Install AutoHotKey
    You can download it here

  2. Clone this repo
    git clone https://github.com/Ajhad1/AutoHotkeyScripts.git

  3. Duplicate the AutoHotKey.ahk file to the Documents folder
    When AutoHotKey starts up, it looks for a file named AutoHotKey.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%
  1. 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 type shell:startup to open your Startup folder. Then paste the AutoHotKey shortcut in this folder.

Usage

  1. Edit Settings.ini as needed
  2. Run Main.ahk

Structure

.
|-- Main.ahk
|-- Settings.ini
|-- Scripts\
|   |-- AppSpecific.ahk
|   |-- Functions.ahk
|   |-- HotStrings.ahk
|   `-- Hotkeys.ahk
|-- Lib\
`-- Util\

Customization

Hotkeys.ahk

Universal shortcuts

; Ctrl+Alt+R to reload entire script
^!r::Reload

Hotkey Docs

Hotstrings.ahk

Auto-expanding Hotstrings are stored here

; Single Line
::btw::by the way

; Multi-Line
::btw::
    MsgBox You typed "btw".
Return

Hotstrings Docs

Functions.ahk

Re-usable functions, automatically loaded by Main.ahk

 Add(x, y)
 {
     return x + y
 }

Function Docs

AppSpecific.ahk

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