We recently showed you how to add Bit.ly URL shortening to Quicksilver, and now reader Kevin has made an AutoHotkey script so Windows users can enjoy quick, keyboard-based URL shortening.
Kevin was also nice enough to include some instructions for those that want to customise the script (which some may need to, depending on the speed of your internet or browser of choice). All you need to do to launch the script is hit Ctrl+Shift+B, and the current URL in Firefox will be shortened and copied to the clipboard. (Note, you can use another browser, but you’d need to modify his script.) You could change the shortcut if you want as well. The script is as follows:
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
waitTimeLoad = 700 ;; for slower internet connections, this number needs to be larger (in milliseconds)
waitTimeKey = 200 ;; for slower computers, this number needs to be larger (in milliseconds)
^+b:: ;; delete this to make this script run once and stop (for keyboard launchers)
IfWinExist, ahk_class MozillaUIWindowClass ;; modify ahk_class for use with other browsers
Send ^c ;; put URL in clipboard
Sleep %waitTimeKey% ;; change this for your pc
msgbox %clipboard%`n`nShortened URL Copied to clipboard
Just throw it into your Startup folder or add it to your existing AHK startup script (You’ll need AutoHotkey installed for this to work). Got any other tips for quick URL shortening? Share them in the comments! Thanks, Kevin!