Mute the Mac OS X startup sound, the fastest way

Published October 13, 2012

Copy/paste lines below and put in your password when prompted to disable OS X startup chime.

sudo sh -c "echo '#'"'!'"'/bin/sh\nosascript -e \"set volume without output muted\"'>/usr/local/bin/unmute"
sudo sh -c "echo '#'"'!'"'/bin/sh\nosascript -e \"set volume with output muted\"'>/usr/local/bin/mute"
sudo chmod a+x /usr/local/bin/mute /usr/local/bin/unmute
sudo defaults write LoginHook /usr/local/bin/unmute
sudo defaults write LogoutHook /usr/local/bin/mute

This code will create two shell scripts, /usr/local/bin/unmute, /usr/local/bin/mute that will execute these AppleScripts:

set volume without output muted


set volume with output muted

After this, the code will bind those scripts to the LoginHook and LogoutHook handlers: when you will log out, sound will be muted, after you logged in, sound will be un-muted.

If you want to restore startup chime, type:

sudo defaults delete LoginHook
sudo defaults delete LogoutHook
sudo rm /usr/local/bin/mute /usr/local/bin/unmute

  Read more

Mac OS X: Launch Terminal from keyboard shortcut

Published September 27, 2012

OSX as is doesn't allow users to set keyboard shortcuts to launch applications, but there are a bunch of 3rd-party softwares and workarounds to achieve that.

If you don't want to use a 3d-party app then the best way to do that is creating a service that just launches an application, and then bind it to a given keyboard shortcut. Let's start:

  1. Open and choose new "Service" document

    Automator screenshot

  2. In the right tab, set "Service receives" to "no input", then drag and drop "Run AppleScript" action to the workflow:

    "Run AppleScript" is located under "Utility" section.

    Automator screenshot

  3. Set the content of the script to:

    on run {input, parameters}
      tell application "Terminal"
      end tell
    end run
  4. Save the document as "Open Terminal" (or whatever) and close
  5. Go to System Preferences->Keyboard->Keyboard Shortcuts->Services, then scroll until you find your new service under General section and assign it a shortcut.

    Prefpane screenshot


This works with all of the applications, you just have to replace Terminal with what you want.

  Read more

« prev 1 2 3 4 next »