How to Use AutoHotkey: 15 Steps (with Pictures) - wikiHow (2024)

  • Categories
  • Computers and Electronics
  • Internet
  • Website Application Instructions

Download Article

Written byTravis Boylls

Last Updated: August 31, 2023Tested

Download Article

  • Installing AutoHotkey
  • |
  • Creating a Script
  • |
  • Creating a Hotkey
  • |
  • Creating a Hotstring
  • |
  • Launching Apps or Websites

AutoHotkey is a free Windows scripting language that allows you to program different actions with various keyboard shortcuts. This wikiHow guide will show you how to install AutoHotkey as well as program a few basic scripts.

Part 1

Part 1 of 5:

Installing AutoHotkey

Download Article

  1. 1

    Go to https://autohotkey.com in a web browser. Using your preferred web browser, go to official AutoHotkey website.

  2. 2

    Click Download. It's the green button in the center of the page.

    Advertisem*nt

  3. 3

    Click Download AutoHotkey Installer. It's the blue button at the top of the page. This will start the download of the AutoHotkey installer.

  4. 4

    Run the installation file. Double-click the installation file you just downloaded to start the installer.

    • By default, all your downloaded files can be found in your Downloads folder.
  5. 5

    Click Express Installation. It's the first option in the AutoHotkey Setup wizard. This will install AutoHotkey on your computer with the default configuration.

    • When it's finished installing you can click "Run AutoHotkey" to launch some of the documentation about AutoHotkey.
  6. Advertisem*nt

Part 2

Part 2 of 5:

Creating a Script

Download Article

  1. 1

    Right-click your desktop. When you right-click on any blank part of your desktop, this opens a drop-down menu.

  2. 2

    Hover the mouse over New. When you place the mouse cursor over "New" you will see a list of programs you can create a new file for.

  3. 3

    Click AutoHotkey Script. This will create a new AutoHotkey script on your desktop. It will have an image of a white page with a red "H" on it.

  4. 4

    Rename the AutoHotkey file. By default, the new document will be named "NewAutoHotkeyScript.ahk" and it will be highlighted, allowing you type a new name for your script.

    • Be sure not to erase the file extension of ".ahk" at the end. Your file must end with the ".ahk" file extension or else it won't work with AutoHotkey.
  5. 5

    Right-click your new script. This will open a drop-down menu with additional options for the file.

  6. 6

    Click Edit Script. It's the third option from the top. This will launch the AutoHotkey script in Notepad. This is where you will write the programming to create your first AutoHotkey script.

    • There is some code and text already inserted into the first few lines of every new AHK script, you can ignore this and leave it alone for now.
  7. Advertisem*nt

Part 3

Part 3 of 5:

Creating a Hotkey

Download Article

  1. 1

    On a new line, type the code for the keyboard shortcut you want to assign. For example, if you want to assign a command that does something when you press the key combination of Ctrl+E, you would type ^e. Each lowercase letter represents its own key, while special keys have their own symbols:

    • + = Shift
    • ^ = Ctrl
    • ! = Alt
    • # = Win (Windows key)
    • Click here for a complete list of key commands.
  2. 2

    Type two colons after the keys you assigned. Any key or key combination you typed needs to be followed by ::. So in our example, the first line of our code would look like:

      ^e::
  3. 3

    Press Enter to go to the next line and press Tab to indent. You'll type the command for what will happen with then hotkey is pressed on the line below the two colons. You can indent the line by pressing "Tab" or by typing several spaces

    • You don't have to indent the command line but it will keep your code organized and easy to read if you have errors later.
  4. 4

    Type Send, and then type a message. The Send command will automatically type a message when a Hotkey is triggered. Anything you type after the comma will be typed automatically when you press the assigned Hotkey. For our example, if you wanted to include the message "wikiHow is awesome!" your code would look like:

      ^e:: Send, wikiHow is awesome{!}
    • Special characters, like the exclamation mark, must be enclosed in braces { } so it isn't confused with the symbol for the "Alt" key.
  5. 5

    Press Enter to go the next line and type Return. The Return command denotes the end of a command and stops the code from going to the lines below.[1] Your finished code should look like:

      ^e:: Send, wikiHow is awesome{!}Return
  6. 6

    Save your script. Click "File" in the menu bar at the top of Notepad and click "Save" in the drop-down menu. This will save the code you've added to the script file.

    • You can close Notepad once your work has been saved.
  7. 7

    Run the script. Double-click the script file on your desktop to run the script. You'll see a green AutoHotkey icon appear in your system tray on the bottom-right of your screen. This indicates that an AutoHotkey script is active.

  8. 8

    Test your Hotkey. Open a new word processing app or any app you can type text and press your Hotkey combo. In our example, if you press Ctrl+E you'll see the text "wikiHow is awesome!" instantly appear.

  9. Advertisem*nt

Part 4

Part 4 of 5:

Creating a Hotstring

Download Article

  1. 1

    Open your script or create a new one. You can open the script you were working on earlier and add a new command to it or create a new script from scratch.

    • Right-click the script and select "Edit Script" to edit the previous script.
    • Right-click the desktop and go to "New," then select "Auto Hotkey Script."
  2. 2

    Go to a new line and type two colons. A Hotstring command starts with :: at the beginning.

    • A Hotstring can take a word or phrase you type and replace it with a different word or phrase.
  3. 3

    Type the letters, word, or phrase you want to replace. For example, you can create a Hotstring so that every time you type the acronym "btw" it would automatically change it to "By the way," so you didn't have to type it all out. In that example, so far your code would look like:

  4. 4

    Type two more colons again. This will separate the end of the message you want to replace from the words or you want to replace it with. Using our example, the code would look like:

      ::btw::
  5. 5

    Type the message you want to replace it with. The message you type after the second pair of colons will automatically replace the first message in between the two sets of colons. In our example, the code would look like:

      ::btw::By the way,
    • Hotstrings don't need a "Return" command and the end because they are self-contained on one line of a script
  6. 6

    Save and run the script to test it out. Just like before, save your work by clicking "File" and "Save"—then double-click the script to run it. Then open any app or program you can type in to test it out. When you type the letters "btw" onto any page, it should immediately be replaced with "By the way," in the text field.

  7. Advertisem*nt

Part 5

Part 5 of 5:

Launching Apps or Websites

Download Article

  1. 1

    Open your script or create a new one. You can open the script you were working on earlier and add a new command to it or create a new script from scratch.

    • Right-click the script and select "Edit Script" to edit the previous script.
    • Right-click the desktop and go to "New," then select "Auto Hotkey Script."
  2. 2

    On a new line, type the code for the Hotkeys you want to assign. For example, if you wanted to open the wikiHow website whenever you pressed they keys Wind+W, you would type the code #w because "#" is the symbol for the Windows key and "w" is the code for the W key. In that example, the code would look like:

    #w
    • Click here for a complete list of key symbols if you want to use a different key combination for your Hotkey.
  3. 3

    Type the two colons, then go to the next line and indent. Immediately after typing the code for the keyboard shortcut, type two colons :: and then press Enter to go to the next line. Indent the line using several spaces or the Tab key.

    • You don't have to indent the command line but it will keep your code organized and easy to read if you have errors later.
  4. 4

    Type Run,. The Run command can be used to launch any program, application or website. Type Run, with the comma at the end and Auto Hotkey will look for the name or location of any program or website listed after the comma. In our example, the code so far would look like:

    #w:: Run,
  5. 5

    Type the full location of any program on your computer or type any website's full URL. For example, if you wanted your Hotkey to launch Internet Explorer, you would type C:\Program Files\internet explorer\iexplore.exe after the Run command. In our example, since we want to launch the wikiHow website, our code would look like:

    #w:: Run, https://wikihow.com
  6. 6

    Press Enter to go the next line and type Return. The Return command denotes the end of a command and stops the code from going to the lines below. In our example. your finished code should look like:

    #w:: Run, https://wikihow.comReturn
  7. 7

    Save and run the script to test it out. Just like before, save your work by clicking "File" and "Save"—then double-click the script to run it. If you followed our example, whenever you press the key combination of Win+W, the wikiHow website will open in your default browser!

  8. Advertisem*nt

Expert Q&A

Ask a Question

200 characters left

Include your email address to get a message when this question is answered.

Submit

      Advertisem*nt

      Submit a Tip

      All tip submissions are carefully reviewed before being published

      Submit

      Thanks for submitting a tip for review!

      You Might Also Like

      5 Easy Ways to Get Around ChatGPT Security Filters
      How to Download and Install Cinema HD on Fire StickHow to Screen Share Crunchyroll on Discord with Friends6 Ways to Undo Accidental Typing and Deleting in NotesSimple Steps to Solve "Spotify Can't Play This Right Now"3 Simple Ways to Share Your Venmo LinkHow to Access Blocked Sites Without a VPN: School, Work, and Home

      Advertisem*nt

      About This Article

      How to Use AutoHotkey: 15 Steps (with Pictures) - wikiHow (54)

      Written by:

      Travis Boylls

      wikiHow Technology Writer

      This article was co-authored by wikiHow staff writer, Travis Boylls. Travis Boylls is a Technology Writer and Editor for wikiHow. Travis has experience writing technology-related articles, providing software customer service, and in graphic design. He specializes in Windows, macOS, Android, iOS, and Linux platforms. He studied graphic design at Pikes Peak Community College. This article has been viewed 90,315 times.

      How helpful is this?

      Co-authors: 5

      Updated: August 31, 2023

      Views:90,315

      Categories: Website Application Instructions

      Article SummaryX

      1.Install AutoHotkey from https://www.autohotkey.com.
      2.Right-click the desktop and click New.
      3.Click AutoHotkey Script.
      4.Right-click the script icon and select Edit Script.
      5.Enter the code for the keyboard shortcut followed by two colons.
      6.Press Enter.
      7.Type "Send" followed by the word(s) or command.
      8.Press Enter.
      9.Type "Return" and save the file.
      10.Double-click the script to run it.

      Did this summary help you?

      In other languages

      Spanish

      Portuguese

      • Print
      • Send fan mail to authors

      Thanks to all authors for creating a page that has been read 90,315 times.

      Is this article up to date?

      Advertisem*nt

      How to Use AutoHotkey: 15 Steps (with Pictures) - wikiHow (2024)
      Top Articles
      Latest Posts
      Article information

      Author: Msgr. Benton Quitzon

      Last Updated:

      Views: 6268

      Rating: 4.2 / 5 (63 voted)

      Reviews: 94% of readers found this page helpful

      Author information

      Name: Msgr. Benton Quitzon

      Birthday: 2001-08-13

      Address: 96487 Kris Cliff, Teresiafurt, WI 95201

      Phone: +9418513585781

      Job: Senior Designer

      Hobby: Calligraphy, Rowing, Vacation, Geocaching, Web surfing, Electronics, Electronics

      Introduction: My name is Msgr. Benton Quitzon, I am a comfortable, charming, thankful, happy, adventurous, handsome, precious person who loves writing and wants to share my knowledge and understanding with you.