So here it is. The proof of concept Finder Hiding widget. So why did I bother? What’s the big idea? It goes basically like this: Apple TV (and, presumably the upcoming iPhone) can run many Intel Mac OS X applications because Apple TV is, essentially, an OS X computer that runs a slight variant on the OS. However, Finder wants to take over and control the way users interact with the unit. It refuses to hide, it refuses to hand over control to another app.

More after the jump…

Sure, you can ssh your way in and replace Finder.app with another application or use other low down dirty tricks to get Finder to behave by, essentially, breaking it but my goal was to expand the way people could interact with Finder without replacing it or breaking the system. In other words, I wanted to prove that you could write a plug-in that adds itself to Finder and allows you to call and execute another application, handing over interactive control to that application until you quit and returned to the Apple TV interface.

The first step to this was my Perl plug-in. It allows you to run arbitrary perl code and returns a simple alert screen showing the output of that program. But the program runs in the background. I wanted to push things further. Sure, I could make VLC start playing back a movie but it played behind Finder. You could hear it but not see it and you could not interact with it.

So where are things now? The Hider plug-in tells Finder to close and hide its windows and it stops the screen saver from starting up. The application you run (it’s compiled in right now, and it’s VLC–which must be ported over by hand to Apple TV) can now be seen and used. Finder, using NSTask, waits until the subprocess terminates, and then returns. It’s still really crude–I’d much prefer bringing back the finder by pressing Menu, and having the child task pause until re-selected, and I should store the previous screenSaverTimeout instead of just assigning 20 seconds by fiat, but say it with me: “Proof of Concept”, not deliverable product.

If you want to give the Hider appliance a spin, you can download a copy here: Download file. Use at your own risk and please do not sue.

- (id)applianceControllerWithScene:(id)scene {

    NSTask *myTask = [[NSTask alloc] init];
    [myTask setLaunchPath:@"/Applications/VLC.app/Contents/MacOS/VLC"];

    [[NSNotificationCenter defaultCenter] postNotificationName: @"BRDisplayManagerStopRenderingNotification" object: [BRDisplayManager sharedInstance]];
    [[BRSettingsFacade settingsFacade] setScreenSaverTimeout:0];
    [[BRDisplayManager sharedInstance] releaseAllDisplays];
    [myTask launch];
    [myTask waitUntilExit];
    [[BRDisplayManager sharedInstance] captureAllDisplays];
    [[BRSettingsFacade settingsFacade] setScreenSaverTimeout:20];
    [[NSNotificationCenter defaultCenter] postNotificationName: @"BRDisplayManagerResumeRenderingNotification" object: [BRDisplayManager sharedInstance]];
    [scene renderScene];
    return self;
}