Thanks, that does seem to work but doesn't really solve the problem, since it requires changing all audio output cells every time I connect to a different device (this is on a laptop that I sometimes use in my office or on the bus or train with the laptop speakers or headphones, and sometimes in a classroom with HDMI). If I set it to "HDMI" and then try to use it without an HDMI device connected, I get an error until I change the setting.
What I'd really like to find is an option to just use the default OS X output device like every other application. Ideally $DefaultAudioOutputDevice would follow the OS X system settings, and not default to the built-in output (internal speakers for a Mac Book Pro).