jamzsabb jamzsabb - 1 year ago 92
AppleScript Question

hide menu bar and dock globally with applescript

I'm trying to get the dock and menu bar in OS X Lion to auto-hide globally. The reason I want it to do so for all programs is because I'm trying to play a game in wine, and when running in fullscreen the CPU usage goes through the roof, so while playing windowed I've always had to manually tell the dock to hide before playing.

I know about editing info.plist and LSUIPresentationMode key, but unfortunately the game launcher notices that the file has been edited and fixes it before launching. So my only choice is to make it hide for all programs before starting, is this possible? Is AppleScript even the best way to go about this? I'm still pretty new to coding on the Mac so any suggestions on how to accomplish this are appreciated.

Answer Source

You can do the dock easily. I do not know how to do the menu bar globally. I doubt it's possible. Here's a script for the dock. It will toggle it to auto-hide or not based on the current condition. Good luck.

tell application "System Events"
    tell dock preferences to set autohide to not autohide
end tell
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download