Skip to content

Instantly share code, notes, and snippets.

@psygo
Created August 8, 2020 21:31
Show Gist options
  • Save psygo/a1b9a60574aee45413e37d196f2d4c09 to your computer and use it in GitHub Desktop.
Save psygo/a1b9a60574aee45413e37d196f2d4c09 to your computer and use it in GitHub Desktop.
AutoHotKey Simple Example
#j::
Send, nuclear launch codes
return
::ftw::Free the whales

AutoHotKey

A nice place to start is this.

1. First script

1.1. Simple Hotkey

#j::
Send, nuclear launch codes
return

The # means the Windows key. The ^ would mean the Ctrl key. So, in the example above, we would have Windows + j typing the text nuclear launch test codes. The return on the third line is necessary to avoid syntactical problems in general.

1.2. Simple Hotstring

When you press a hotkey combination, after the release, something will happen. The difference to a hotstring is that something will happen after you type the string, which might even get completely transformed into another string.

::ftw::Free the whales

For example, the code code above will transform the hotstring ftw into Free the whales after you type it.

2. Making it work

To make it work, after having AutoHotKey installed in your machine:

  1. Create a new file, either with:
    • right-click + New + AutoHotKey Script
    • Simply create a new text file and have its extension as .ahk.
  2. Type your code inside it.
  3. Double click your .ahk file to run it.

Now, everything should be working.

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