I've recently been playing with iTunes and AppleScript quite a bit, for the wire-and-string remote project (of which more soon, once I get a workable server out of Tom). One of the things I've noticed is that there's no way of asking for AppleEvents.
Perhaps it's best to describe why I'd want that in the first place. I'm writing something that monitors the state of iTunes, and in particular when it's playing a new track. Of course, there are plenty of applications that already do this. However, they all have to do the same thing; repeatedly ask iTunes what it's playing and act when that changes. Some of them, notably Kung-Tunes, can rely on network latency to reduce the poll interval, but PTHiTunesNotifier (and, as it happens, my app) have to ask iTunes about every two seconds.
As it turns out, this isn't too much of a processor drag, especially as iTunes is so heavy itself. But even so, shouldn't there be a neater way of doing this?
Apple itself gives us the answer. In the Cocoa programming tool kit, Matt Webb pointed out, there's an NSNotificationCenter (thanks, Peter) object. This works as a publication/subscription hub, which sounds complex, but is quite straightforward: objects let the hub know what events they're interested in. When an event happens, the object that handles the event merely forwards it to the hub, which then forwards it on to the next applications that want to know.
The analogous AppleEvent pubsubhub would, then, take messages from applications like iChatStatus saying "I'd like to know when iTunes moves on to the next track". iTunes would message the hub when this happened, and the hub would pass that on to any interested applications, hence cutting down the amount of AppleEvent traffic to a bare minimum.
This is ripe for a third party to develop, although of course iTunes and Mail.app - the prime candidates for sending events - would need Apple's support to get it working. Even so, a pubsubhub that could handle NetNewsWire sending events every time your favourite sites were updated and quietly opening browser windows minimized in the dock, for example, might get the ball rolling.
I've got about three brewing posts for this place, but instead of actually writing them up, or finishing the book review I promised London.pm, I ended up spending Sunday yak-shaving.
In particular, I went through all the MT templates I needed to, adding comment pages inline (as opposed to the default templates which use horrible nasty popups), fixing their usability by moving the form elements around and writing some mildly hairy logic for a nice layout on the front page. I did look at Simplecomments, but decided against it. (Of course, today I've found a rant by Tom Coates about it. Now, I'm not that bothered about building a community or whatever here, but it's interesting to see what people who do care think about it.) It also means I've enabled TrackBack; time will tell if it's useful.
I've also tidied up the optional RSS feed that contains full entries. For a long time I've been fighting a losing battle that one of the initials in RSS stands for 'Summary', but the post-NNW world seems to think that having to visit a website is a grievous affront to their human rights, and an invitation to write scrapers. (Of course, I've done a bit of that in my time, too. Ho hum.) So I caved in.
Of course, I don't update chaff anything like frequently. In the unlikely case you really want to read more by me, I tend to linkdump on 2lmc's blog these days, and there's occasionally a new photo set on stem, my photo archive, which I'm considering adding RSS to. (Yay, more removed hairy mammal covering.)
Anyway, now that's done, I can get on and actually write something.
Taking the Circle Line into work because of snow, and seeing huge and complex reflections of the low sun on a building in Farringdon.
Seeing a man carrying a huge bunch of flowers on the Bakerloo line on a Friday evening.
Condensation on the inside of a number 10 bus window turning every streetlight into a spectral halo.