03 September, 2013

Generate Hyperlinks using AutoHotKey

There are two ways generate a click-able hyperlink - either use a HTML editor where you have to first type the Title and then copy paste the URL or use a text editor like Notepad to type Title and URL in the format
Title.

Using AutoHotKey you can generate the above format with just a hotkey.

First install AutoHotKey.

Now in your favorite text editor type the following lines.

 !F6::
Send, {ALTDOWN}d{ALTUP}{CTRLDOWN}c{CTRLUP}
Sleep, 100
WinGetActiveTitle, Title
Sleep, 100
clipboard = %Title%


Save the text file with a ahk extension.
For example if you want the file name as GetWinTitle,  save it as GetWinTitle.ahk

The hotkey in the above code is Alt+F6.

When you will press the hotkey combination while on an active browser window, AutoHotKey will copy both the URL and the Title and save the HTML code in the Windows clipboard.

Now, you can copy paste the HTML directly where you want.

On my computer the above script gave the following code when run on a Google homepage:


StringTrimRight, Title, Title, 18

This will remove last 18 from right and will give the following result.

No comments:

Post a Comment