Create A Shortcut Key To Replace Text With Hyperlinks In Any Editor

If you do most of your editing in a plain text environment, you don't get to take advantage of time-saving features like easily replacing text with hyperlinks—but a quick AutoHotkey script can make it much easier.

Over at the How-To Geek site (my home away from Lifehacker), we've created an AutoHotkey script that automates the process of creating a hyperlink—simply copy the URL to the clipboard, highlight the text you want to link in any text editor, and then hit the shortcut key to replace the text with a fully formatted URL.

To create your own hyperlink-enabling script, just create a new AutoHotkey script or add the following to your existing script:

!9::

{

Sleep, 100

clipurl := clipboard

Send ^c

Sleep, 50

clipurl := "<a href=""" . clipurl . """>" . clipboard . "</a>"

SendInput {Raw}%clipurl%

clipboard := clipurl

clipurl =;

Return

}

You can customise the shortcut key from the default of Alt+9 to something else if you prefer by editing the first line. Hit the link for the full explanation as well as a downloadable version of the script.

Create Your Own "Insert Hyperlink" Feature in Any App with AutoHotkey [How-To Geek]


Comments

Be the first to comment on this story!

Trending Stories Right Now