InsertableContentSource

The development world of a madman

July 13, 2010

Top Tips For Live Writer Plug-in Developers

Whether you’ve written Live Writer plug-ins before, or if you’re just thinking about writing your first, hopefully this post will give you some good tips that will help you build that new plug-in.

Use A Visual Studio Template

I would highly recommend downloading a Visual Studio template. The template can be downloaded for machines running x86 or x64 flavours of Windows (for VB.NET devs, downloads are x86 and x64). The reason I have done ones for both architectures is because otherwise you have to remove and then re-add the reference to WindowsLive.Writer.Api.dll as it will be looking in the wrong Program Files folder. The template itself is based on a combination of templates written by myself and Ben Hall.

To install the template, download the zip file above for which ever architecture of Windows you’re running, rename the zip to be called LiveWriterPlugin.zip, and put it in your template folder (by default this will be %VisualStudioFolder%\Templates\ProjectTemplates\Visual C#\ or Visual Basic if using the VB template). When you then go to create a new project, you will be given a new project type to choose from:
NewLiveWriterPluginProject

This will create a new project with a default plug-in type of ContentSource, although this can be changed to whichever type of plug-in you’re wanting to create. I am hoping that I can create something better for templates, but for now, this will suffice.

Note: All these templates will work with all flavours of Visual Studio from 2005 up to and including 2010 (including Express editions).

Make Sure The Plug-in Copies Automatically To The Plugin Folder

If you’re using the template from above, then you can skip this tip. Right click your plug-in’s project and go to the properties, in the Build Events tab have this: XCOPY /D /Y /R "$(TargetPath)" "C:\Program Files (x86)\Windows Live\Writer\Plugins\" (removing the (x86) reference if you’re on an x86 OS), so you should see this:
LiveWriterBuildEvents

What this will do is every time you build your project, it will put that latest build in your Live Writer plugins folder so when Live Writer is opened, you will already have the latest copy loaded. This proves handy for the next tip.

Run Live Writer When Debugging Plug-ins

Because Live Writer plug-ins are just dlls, it makes it somewhat more difficult to actually debug them, however, with just a simple change to the project’s properties (again), we can make this oh so easy. In the debug section of our project’s properties, we set it to open an external program, in our case Live Writer itself which is at C:\Program Files (x86)\Windows Live\Writer\WindowsLiveWriter.exe.
image

By doing this, we get full debug capabilities of our plug-in.

Add Plug-in Options to the QAT (Wave 4 and newer)

With the latest beta of Live Writer, we have been given the Ribbon UI that has been present in Office for a few years now. One of the features of this is the Quick Access Toolbar (QAT) and you can pin just about any command from Live Writer to the Ribbon (except your own plug-in). One of the things you can pin to the Ribbon is the button for the plug-in options. Normally, this is in the Insert tab as seen below:
LiveWriterPluginOptionsNormal

But we can pin that to the QAT by right clicking it and clicking Add to Quick Access Toolbar
LiveWriterAddToQAT

Which gives us
LiveWriterOptionsOnQAT

What this actually means is if your plug-in as options and you’re making sure this works ok, it gives you really quick access to those options (clue is in the name I guess) as it opens the Live Writer options on the plug-in page.

So there’s my list of top tips when it comes to developing Live Writer plug-ins. Do you have any of your own? If so, do please share them in the comments.

SL

July 5, 2010

Writerous (The Posterous Plug-in For Live Writer) Has Been Updated

Writerous is my Live Writer plug-in that I made to allow users to use Live Writer to publish to Posterous, something which can’t be done in Live Writer natively (due to the Posterous API). I was recently made aware of a post in the discussion section on Codeplex for Writerous, which I had sadly missed, asking for an alteration to the plug-in (or in my eyes, an extra option).

Now, the way in which Writerous works is you have to have a “dummy” blog configured within Live Writer, nothing will get published to it, but it needs to be there for the act of publishing so that Writerous can then do its thing.

The suggestion from Julian was to have the ability to not only publish to posterous, but also publish to the “dummy” blog, and no longer make it a dummy blog, so this is what has been updated. To set this up, simply go to the Writerous options within Live Writer and check the box to post to hosting blog:

NewWriterousOptions

It’s as simple as that. Once you publish, instead of getting the message about publishing being cancelled, Live Writer will continue and publish the post as you would normally expect.

Please remember, if you have any feedback, go to the Writerous site on Codeplex or send a message to @writerous. If you have done either of those things and I haven’t responded, do please prod me on my main twitter account @scottisafool.

SL

July 2, 2010

Twitter Notify, Because No-one Should Be Hacking The Registry

Anyone who uses the Twitter Notify plug-in for Live Writer will know that it gives you a tinyURL.com url to tweet your link with, but sometimes, tinyURL isn’t what you want to be using, perhaps you prefer is.gd, or you have your own bit.ly account and want to use your own user details. Joe Cheng, when he was on the Writer team, wrote a blog post detailing how to go about changing this. Then, again, today Aaron Bregel, the Test Lead on the Writer team, wrote another post on how to go one step further and use the bit.ly API key.

Now, both of these posts are fine, and give you good instructions on how to change the setting, but it involves a registry change. The registry is not a place people should really be changing stuff by themselves, no matter how good the instructions, someone will screw it up.

So I decided what was needed was a little tweaker utility, so I quickly wrote one:

image

Enjoy.

Download

SL

May 9, 2010

Blackbird Pie Twitter Plugin for Live Writer

Hot on the heels of the Google Buzz plugin, is a plugin that I wrote for @stevecla that lets you insert a twitter quote from a new service called Blackbird Pie. Basically this service lets you put in a tweet url and get the code to put on your blog/website that shows that tweet, for example:


Twitter Blackbird Pie Plugin for Windows Live Writer http://bit.ly/c0Fobsless than a minute ago via API

The plugin is easy enough to use, just click on Twitter Quote from the Insert menu, which gives you this screen:

image

Paste your link into the box shown, hit Bake It, then once the tweet has loaded, press insert. Job done.

Now, this service looks to be some guys little pet project from twitter, and not a fully fledged service, which means it could possibly be taken down at a moment’s notice. For this reason, I will not be releasing the plugin on Live Gallery as I would normally, instead, I’ll make it available to download off my own server. There will also be no installer for this, so it’s a manual installation, so just extract the dll to Program Files\Windows Live\Writer\Plugins.

Download link.

SL

May 8, 2010

Google Buzz Live Writer Plugin

Recently, I was badgered by @jas to make him a Live Writer plugin similar to the Tweetmeme plugins I’ve written. The plugin he wanted was for Google Buzz, you know, that service from Google that only Google uses.

Anyway, I wrote the plugin, it’s all done, and it inserts a Buzz icon where you choose it to in the options:

image

It’s now available on Live Gallery (finally), so go download it.

NOTE: This plugin won’t work if your blog engine strips javascript. WordPress.com, I’m looking at you!

SL

Welcome to my new blog

by @ 16:56. Filed under non-dev

Hi, and welcome to my new blog. I have made the decision after a lot of grief to move my blog away from http://scottisafooldev.spaces.live.com and put it in a new home. My reasons for doing this included constant spam comments and no way of preventing them, and for an unexplained reason, I was actually unable to post to the blog for Live Writer. Imagine that.

So anyway, please update your bookmarks and RSS feeds.

SL

[InsertableContentSource is proudly powered by WordPress.]