More on the ‘Software for Individuals’ meme

Hulu started it’s beta testing yesterday.

Hulu is NBC (and other media companies) attempt to provide video programmes to individuals outside of the iTunes environment (in other words this is NBC’s answer to it’s break up from iTunes).

The Hulu blog post on the opening of beta testing has some particularly choice comments.

It seems like this service (rather than iTunes) is not designed for the individual – rather it’s designed for the corporate entity that created it, poor implementation details, and geographical restrictions on what you can watch depending on where you’re connecting from.

Posted under Personal

This post was written by awk on October 30, 2007

Why I don’t ‘do’ Enterprise Software

Jason Fried has a nice article on ‘Why Enterprise Software Sucks‘ with which I agree entirely.For the last 10 years I’ve worked entirely on projects that individuals use – indeed the lack of the individual focus was why I left two previous employers. If I decide to move on from my current position I suspect that a shift away from focusing on the individual will be part of the reason why.One of the great things about the iOnTV project is that it’s entirely individually focused and I think this is also a driving force behind many of the ‘indie’ developers out there today for the Mac. I really don’t think Gus Mueller had the large art department in mind when he wrote Acorn, and Wil Shipley clearly doesn’t design Delicious Library for ‘libraries’. Both of these folks (and so many, many more) are focused entirely on the individual. 

Posted under Development, Personal

This post was written by awk on October 29, 2007

Leopard Upgrades

I upgraded my Intel Mac Mini and PowerPC PowerBook this weekend with the final version of Leopard. Upgrading the Mac Mini was completely painless with no problems whatsoever.The PowerBook however was  more troublesome. After a backup using SuperDuper (always  backup before installing 8-) I began the upgrade. Why upgrade and not a clean or ‘archive’ install ? Well I don’t really have the disk space for an archive install (which moves the old /System folder aside and creates a new one), also I didn’t really feel like spending another couple of hours restoring all my old stuff – and hey upgrades are supposed to work !Shortly after beginning the install the Installer Application displayed an error dialog and told me to reboot with a message of ‘try again’. Unfortunately on the next reboot from the installation DVD my hard drives were ‘missing’ (don’t panic !) I know they’re still in the box somewhere -  but perhaps I will be doing a clean install after all ! Running Disk Utility from the installation DVD didn’t help. I’d had a problem during the Leopard betas where the Tiger partition (my drive has two partitions one for ‘seed’ releases the other for the current shipping version) would somehow get set to ‘invisible’ – it seemed like this problem had occurred in the middle of the installation !Fortunately I had a copy of TechWarrior DiskTools and ran the repair process – this seemed to recover everything back to how it had been before and this time the installation process worked fine…Until I launched Mail when it complained about ‘not having a keychain’. This too had an echo of the past – I remembered that a couple of years ago I had had a problem with a keychain also ‘disappearing’ magically. It too looked to have reoccurred. I launched the Keychain Access program and ran it’s ‘first aid’ option and saw that it was complaining about a ‘login’ keychain but no ‘awk’ keychain.  I took a gamble and copied the login keychain to awk (~/Library/Keychains/awk.keychain) reran the first aid option and things looked fine. Mail too was happy.So far everything else seems fine – I put my problems down to having a Tiger installation that’s ‘been through the wringer’ a bit over the years. 

Posted under Leopard

This post was written by awk on October 29, 2007

Fake Steve’s sick after visiting ‘The Borg’ ?

See here. Funnily enough the last time I went to the Microsoft Campus I got sick too – only this time I did eat there. I can’t be sure whether it really was the lunch (catered for the event I was at – I didn’t eat in one of the cafeterias) or what I ate that evening off campus for dinner.

Whatever it was – by about 3:00am the next morning having had about 4 hours of continual throwing up I decided to go to the local emergency room. They gave me some compazine and a ton of IV fluids to re-hydrate me and luckily by about 5:30 I was able to go back to the hotel.

Why lucky ? Because this all happened in the early hours of February 28th 2001 – a few hours after I left the Emergency Room it went into full disaster mode because of the Nisqually Earthquake

Posted under Personal

This post was written by awk on October 27, 2007

ScriptingBridge

One of the new ‘developer’ features (i.e. a new API) in Leopard is ScriptingBridge. It’s a significant improvement to the mechanics of driving one application from another using AppleScript/AppleEvents.It’s always been possible to use NSAppleScript in Cocoa to send AppleScript to another application basically using a simple string :

NSString *appleScriptSource = [NSString stringWithFormat:@"tell iTunes to add (POSIX file \"%@\")", moviePath];

NSAppleScript *aScript = [[NSAppleScript alloc] initWithSource:appleScriptSource];

NSAppleEventDescriptor *aDescriptor = [aScript executeAndReturnError:&anError];

Not too bad, and you do get the returned data and in theory you can use that in subsequent scripts to affect the added track (adding metadata, setting it’s kind etc). However it’s slow and still really rather clumsy, and if you want to do any real argument munging you may be forced to revert to NSAppleEvent directly which is really painful and exceedingly longwinded.ScriptingBridge in Leopard makes this much, much more straightforward and friendly. Using the command line sdef and sdp tools you can create an Objective-C 2.0 header file which contains all the scriptable classes and elements of an application. Then you can include the header file and ScriptingBridge framework and the above code becomes:

iTunesApplication *iTunes = [SBApplication applicationWithBundleIdentifier:@"com.apple.iTunes"];

[iTunes setDelegate:self];

NSArray *filesArray = [NSArray arrayWithObject:[NSURL fileURLWithPath:moviePath]];

iTunesTrack *theTrack = [iTunes add:filesArray to:nil];

At first glance it looks like this is about the same code, but it executes much faster (no script parsing/compilation to AppleEvents). The returned object is a real Objective-C object so in the next line you can do :

theTrack.videoKind = iTunesEVdKTVShow;

theTrack.show = movieTitle;

Note – you can use Objective-C 2.0 style properties. Much neater than lines and lines of coded AppleScript. There is one catch – the header file is built from parsing the scripting definitions in the application (the sdef). These can still tend to be rather opaque – and in particular rather ‘type free’. AppleScript generally is a very weak typing language, and if you’re used to strong typing (C like) languages it can be a bit of a mind bending experience. In the iTunes case I struggled for a couple of days with the add: to: message – the generated header says :

- (iTunesTrack *) add:(NSArray *)x to:(SBObject *)to; // add one or more files to a playlist

There’s no indication of type for the contents of the array. Experience with ScriptEditor (and the initial NSAppleScript solution) suggested I should be able to just use an NSString in the array with the POSIX style path. However that failed with a ‘not found’ error when the message was sent. I initially thought it was a problem with the to argument needing to be a valid playlist and I spent quite some time convincing myself that I had a valid playlist argument (basically iterating things in the iTunesApplication object to get down to a playlist). Finally I went back to ScriptEditor and launched it from Terminal with the AEDebug=1 and AEDebugSends=1 environment variable set. This shows on stdout a debug of the AppleEvents that ScriptEditor sends. Looking at the log I could see that ScriptEditor was converting my POSIX path into an ‘furl’ (File URL) ! The lightbulb came on and I adjusted my code to do likewise with an NSURL and everything ‘just worked’ as I’d hoped it would. It is odd however – the definition in the scripting def file actually refers to an ‘alias’ an old world MacOS 7 concept that’s pretty much fallen out of use. I expected the path string to be converted correctly, after all I’d already proven that other AppleEvents in other applications (Sketch2 in Leopard is a good test case) that take alias get converted, however it appears as though there’s something more specific in the iTunes case that needs the file URL.

Posted under Development, Leopard

This post was written by awk on October 26, 2007

Now this is a neat idea

Replug - it’s like the Mag Safe connector on a PowerBook but for 3.5 mm Audio jacks such as on a notebook or iPod. I don’t think it’ll work on the iPhone though, it looks a little too ‘recessed’ to fit.

It also looks like they don’t have an online store or any resellers yet. Still worth keeping an eye on.

Posted under iPhone

This post was written by awk on October 2, 2007