Skip to content

Instantly share code, notes, and snippets.

@carlinmack
Last active November 14, 2019 19:59
Show Gist options
  • Save carlinmack/8cc235d1315e5d34f0c63d6140bdd9c4 to your computer and use it in GitHub Desktop.
Save carlinmack/8cc235d1315e5d34f0c63d6140bdd9c4 to your computer and use it in GitHub Desktop.

AutoHotkey QuickStart Guide

Setup

You wanna download the current version of autohotkey, I'd recommend V2 but I have no idea what the syntax is. After downloading I think it will create a script for you called something like "AutoHotkey.ahk". You can place this anywhere but I put it in my Documents. Once you've found a place for it you will want to copy it. Then go to C:\Users\%UserName%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup. Finally right click and select "Paste shortcut". This will ensure that AutoHotkey runs on start up.

Editing your user script

To make any adjustments, which will be many at the start, find the AHK icon in the notification area. Right click and select "Edit This Script". This will open notepad for you to make changes in. Once you are done save and then right click the AHK icon and select "Reload This Script"

Replacements

  1. Type " abc " replace with " xyz ". This is the most common expansion type thing and is very quick if you make a good system for yourself and remember it.

::abc::xyz

  1. Type " abc " replace with " xyz". This is good for entering email adresses into forms and stuff

:o:abc::xyz

  1. Type "anthingabc " replace with "anythingxyz ". This is good for emoji and mathematical symbols

:?:abc::xyz

Key Combinations

If you want to bind Ctrl+Q to some command you can do

^Q::Command

For reference ^ = ctrl, + = shift, ! = Alt

AutoHotKey is an actual programming language with forloops and macros and stuff so this is a highly specific example I made for closing my browser when I hit F1

    ;    Exiting Vivaldi browser and saving a session so that state is never lost
    F1::
    MouseMove,500, 15
    Sleep 100
    Click
    Send {Alt}
    Sleep 200
    Send f
    Send t
    Sleep 200
    Send, %A_YYYY%.%A_MM%.%A_DD%{space}
    FormatTime, Time, ,H.mm
    SendInput, %Time%
    Sleep 200
    Send {Enter} 
    Sleep 200
    Send {Alt}
    Sleep 750
    Send f
    Send x
    Return

Other:

  1. Replace 'ttt' with date stamp of format YYYY.MM.DD HH.MM
    ::ttt::
    Send, %A_YYYY%.%A_MM%.%A_DD%{space}
    FormatTime, Time, ,H.mm
    SendInput, %Time%
    Return 
  1. Press Ctrl+Space to always keep window visible on top of other windows

^SPACE:: Winset, Alwaysontop, , A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment