Activating Dock auto-hide feature from command line
I'm trying to put a script together that enables autohide when I use my laptop as the main screen, and disable when it's connected to an external display. I've got the detection bit working now. But what I can't seem to get working, is turning the autohide feature on and off.
I find this all over the web ...
Hide-command: defaults write com.apple.Dock autohide -bool TRUE; killall Dock
Show-command: defaults write com.apple.Dock autohide -bool FALSE; killall Dock
And the hide-command works.
But the show-command seems to not be working for some reason.
Also, my desktop flashes when I run either command.
When I hit Opt-Cmd-D, this doesn't happen.
Any recommendations on how I can trigger that shortkey?
Or other thoughts on how to make this work?
MacBook Air, OS X Mountain Lion (10.8.3), 2GHz i7, 8GB RAM, 256GB SSD