I write scripts when I see a way to automate a task that I find myself doing repetitively. Because I force email to text, I frequently get emails with URLs that have a line break. Occasionally they will have a space, tab or even a greater than sign “>” if forwarded from another source. I found myself highlighting the address then pasting it into notepad, removing the junk, recopying and then launching the browser. Truly annoying.
Back in 2004, Scripting Guy Ed Wilson write a script to launch a URL from the clipboard, but it did not clean up the text. I also thought it would be nice to avoid the Internet Explorer clipboard warning when possible. One of the things I wanted to be able to determine was the default browser. Before Windows 8, you could find this in “HKCR\http\shell\open\ddeexec\Application\”. Finding the entry in Windows 8 had me stumped. Ed and Jason (a PFE at Microsoft) located it here: “HKCU\Software\Microsoft\Windows\Shell\Associations\UrlAssociations\http\UserChoice\ProgId”
The resulting script, OpenClipboardURL.vbs, is way too big for the simple task. But it will take advantage of Word’s clipboard if installed, and understands alternate browsers. I use it every day, putting it into Alan’s Favorites.