Hyperlinks are one of the most common features in websites and apps. They allow users to jump to different parts of a document or website with just a click. But how do you create hyperlinks in AutoHotkey? There are a few different ways to do this, but the easiest way is to use the Hyperlink command. To create a hyperlink in AutoHotkey, first open up your script editor and type: Hyperlink “http://www.google.com” This will create a hyperlink that will take you to Google. You can also use the Chr(10) command to create links that open in a new window or tab: Hyperlink “Chr(10)” ..


What we’ve done is put together an AutoHotkey script that automates the process of creating a link, and we’ll demonstrate it using the WordPress post editor, though that’s not the only place you could use this technique.

Using Our New “Insert Hyperlink” Feature

First we’ll assume that you’ve already copied the URL to the clipboard, and then you will simply select some text that you want to turn into a link—assuming you are in the HTML view, of course, since you wouldn’t want to do this in the visual editor.

Now you’ll press the shortcut key that you’ve chosen—for our example, we’re using Alt+9 since that’s rarely taken by anything else…

And just like that, the text is replaced with the hyperlink including the URL you had on the clipboard.

Note: Of course, in the WordPress editor, you could always use the Alt+Shift+A shortcut key instead, which would launch a dialog allowing you to enter the link, but we’re just using this as an example—though you might note that our method requires only a single keystroke.

Creating the “Insert Hyperlink” Feature

To create the feature for yourself, either create a new AutoHotkey script, add the following to your existing script, or download the file at the bottom and run it. Naturally we’re assuming you already have AutoHotkey installed.

Here’s how it works… you’ll notice that we’re using Alt+9 as our keyboard shortcut, but you can customize this to anything else you’d like.

!9::{  Sleep, 100  clipurl := clipboard  Send ^c  Sleep, 50  clipurl := “<a href=”"" . clipurl . “”">" . clipboard . “”  SendInput {Raw}%clipurl%  clipboard := clipurl  clipurl =;  Return}

The first line inside the brackets pauses the script for 1/10th of a second to make sure that you’ve released the shortcut key, then the clipurl := clipboard line copies the current clipboard (the URL) into a variable to save for later. Once that’s done, the script automates copying the selection to the clipboard with Ctrl+C, assembles the link together, and then pastes the whole thing back into the application, replacing the current text in the process. The last step puts the clipboard back to the way it was before you ran the command.

Download the “Insert Hyperlink” AutoHotkey Script