It’s no secret, Windows Live Writer is a great program, but as with every program, it has a few missing spots. And with the Wave 4 beta being just released and seeing what little improvements have actually been made to the program, it can always use a few more.
One of my issues was the ‘autolinking’ in Windows Live Writer and importing links.
To define what that is, Windows Live Writer has a function to allow you to assign a word a hyperlink, and every time you enter/type that word it gets an active link. But there’s no option to import links, so importing/creating a link one at a time via Windows Live Writer is going to be really cumbersome.
I didn’t like that idea… I came up with my own solution.
Autohotkey is another one of my favorite programs. AutoHotKey can automate any process that requires a keyboard or mouse- or whatever; it’s awesome. You can do it manually… But why?
If not already, download and install AutoHotKey; you’ll thank me later.
So Windows Live Writer has an XML file that it keeps it’s ‘linkglossary.xml’. This is just a standard XML file; it can be edited really easy with any text editor.
You can open it up and take a look…
%appdata%
C:\Users\USERNAME\AppData\Roaming\Windows Live Writer\LinkGlossary
Here’s a sample:
<?xml version="1.0" encoding="utf-8" ?>
- <glossary>
- <entry>
<text>Windows Live Writer Blog</text>
<url>http://windowslivewriter.spaces.live.com</url>
<title />
<rel />
<openInNewWindow>False</openInNewWindow>
</entry>
- <entry>
<text>Ubuntu</text>
<url>http://www.Ubuntu.com</url>
<title />
<rel />
<openInNewWindow>True</openInNewWindow>
</entry>
- <entry>
<text>BryanSays</text>
<url>http://bryansays.com/</url>
<title>Bryan ‘Says’ Lee – Official Website</title>
<rel />
<openInNewWindow>True</openInNewWindow>
</entry>
And it goes on and on… Blah blah blah…
Ok, good… moving on…
So what we really need is to be able to grab information and then incorporate that in to the XML file. Ok, how do we do that? With AutoHotKey… [big smile] and a listing of websites and their names/descriptions…
Where To Get A List Of Websites [Autolinks]?
I found a website [among many others] that offers to allow you to download a list of the inets most popular websites, but it could be a list of anything really [kind of]…
What I needed was the URL and the autotext basically… So I needed the URL and something to trigger the link activation…
I found this site, with the file I wanted and then I downloaded it to my machine.
http://www.livelybrowser.com/english.html
Format The Data…
I downloaded the detailed file- it has lots of goody information in it… But you strip what you want and keep what you need. I used OpenOffice to do this task- open the CSV file… The file really needs to have the information in this order. The script works in that order.
Text, URL , title and rel [ation]
Okay, there we go… The data is now organized in to a list, with columns and everything- it’s nice an neat.
Save the file, as a CSV file, using commas as the separation value. It’s actually pretty standard so you really can’t screw that up.
The AutoHotKey Script…
So here’s my script, it’s actually pretty basic. It uses the information in the CSV file to collect the data, line by line and then create another file you can simply copy and paste information at will.
I don’t import the data directly in to the XML file- this is on purpose. This is so you can double check everything before any changes are made. It’s just text- no big deal.
Here’s the script:
;
; AutoHotkey Version: 1.x
; Language: English
; Platform: Win9x/NT
; Author: A.N.Other <napoleonag.tss@gmail.com>
; 07/16/2010
;
; Script Function:
; Template script (you can customize this template by editing "ShellNew\Template.ahk" in your Windows folder)
;#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.s::
start:
clipboard=
Send {home}
Send {shiftdown}{end}{shiftup}
send ^c
clipwaitif clipboard=space
{
traytip, No more entries…`nClosing… Done.
Sleep, 5000
exitapp
}
else
{
StringSplit, LinkArray, clipboard, `,
TrayTip, -> %linkarray1%`n-> %linkarray2%`n-> %linkarray3%`n-> %linkarray4%
FileAppend, <entry>`n, WLWLinks.txt
FileAppend, ` <text>%linkarray1%</text>`n, WLWLinks.txt
FileAppend, ` <url>http://%linkarray2%</url>`n, WLWLinks.txt
FileAppend, ` <title>%linkarray3%</title>`n, WLWLinks.txt
FileAppend, ` <rel>%linkarray4%</rel>`n, WLWLinks.txt
FileAppend, ` <openinnewwindow>True</openinnewwindow>`n, WLWLinks.txt
FileAppend, </entry>`n, WLWLinks.txt
fileappend, `n, WLWLinks.txt
Sleep, 50
send, {down}
goto, start
}
returnx::exitapp
return
On your machine, create a text file, copy paste this information in to that file and save as the filename you want… I don’t care- I’m giving this away free.
The script doesn’t do anything until you press the ‘S’ key on the keyboard. And if you need to kill it, use the ‘X’ key- it’ll close the script from running.
Once started it’ll step through each line of text, parse out the data and then create the XML formatted file for Windows Live Writer [copy paste later].
» The ‘wlwLinks.txt’ file is created in the same folder the script is located.
Let’s Do Something… Parse
Ok, so at this point, I assume some things have been completed…
- You’ve AutoHotKey installed.
- You’ve a lists of websites
- You’ve downloaded the script I wrote to import said list of websites.
Open your CSV file, remove the title listings at the top; they’re not needed and could mess with you on the import.
Run the AutoHotKey script provided…
Put the mouse on the first line of the file that you want to start the import. Press ‘S’…
On my machine about 100 entries in about 5 seconds.
» Again, the ‘wlwLinks.txt’ file is created in the same folder the script is located.
Now Let’s Merge The Files…
Go grab the Windows Live Writer file…
%appdata%
C:\Users\USERNAME\AppData\Roaming\Windows Live Writer\LinkGlossary
It should be the only file in that folder…
Now grab the ‘wlwLinks.txt’ file…
Open both files up with notepad…
Copy everything from the ‘wlwLinks.txt’ file with [CTRL-A][CTRL-C] in the notepad window. Or Edit » Select All / Edit » Copy.
Go to the link glossary.XML… Go to the bottom of the file…
Create a NEW LINE[s] above the </glossary> tag.
Now paste all the links from the txt file. Save the changes to the XML file.
And Finishing…
That’s it! There’s a lot of words here, but all in all, it’s actually very simple. Instructions just take a lot of words…
Now when you run Windows Live Writer all those new ‘autolinks’ are going to be in there.
You don’t have to get your links from any website specifically, but you can see the use in the script [I hope].
You can use it on any links you collect.
And here’s a link to the top 100 sites on the web.
I hope this helps…
Until next time,
LEHenryJr
LEHSYS.com

You want my LinkGlossary.XML? -chuckling. I'll look in to it… I may just create a LinkGlossary.XML of maybe the top/most popular websites on the web… And then let you guys download that…
Fascinating idea… Thanks for your comments…
Until next time,
LEHenryJr
I added it to the post. Download at will.
Enjoy.
Until next time,
LEHenryJr