Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

If you have more than one email account setup in Apple Mail or Sparrow, it's nice to be able to select the one you want to send a message from without having to use the mouse.

How can this be achieved with Keyboard shortcuts?

(Note that the method in http://tiptorial.net/tips/17-creating-a-keyboard-shortcut-to-set-the-current-account-in-apple-mail breaks because System Prefs messes with the menu title)

share|improve this question

1 Answer 1

I found a workaround that isn't ideal.

Follow the setps in http://tiptorial.net/tips/17-creating-a-keyboard-shortcut-to-set-the-current-account-in-apple-mail:

  • go to System Preferences > Keyboard > Keyboard Shortcuts > Application Shortcuts
  • Add (click the +) a shortcut:
    • Select Application: Mail (or Sparrow)
    • Menu Title: Enter the account name and email (e.g. Johnny Appleseed <seedman@example.com>)
    • Shortcut: Select your preferred shortcut (e.g. ^a)

Now, when you close System Preferences, in Lion at least, a > will be added to the beginning, making the Menu Title actually look like: > Johnny Appleseed <seedman@example.com>, which completely breaks the functionality. This is a new bug, as it used to work just fine in Leopard and Snow Leopard.

BUT! You can actually fix the problem by going into the preferences file for the application, and removing the added >. This is not ideal for users who don't use the command line, but this can probably made into a simple bash script using sed or something (feel free to do that and edit this answer).

  • Make sure System Preferences and your mail application are closed.
  • Open the application preferences file with your favorite plist editor (I use TextMate):
    • For Apple Mail: open ~/Library/Preferences/com.apple.mail.plist.
    • For Sparrow: open ~/Library/Preferences/com.sparrowmailapp.sparrow.plist.
  • search for NSUserKeyEquivalents, which will be a dictionary mapping Menu Title to shortcut, something like:

    NSUserKeyEquivalents = {
      "\033Johnny Appleseed <seedman@example.com\033" = "^a";
      "\033Johnny Appleseed <johnny@example.org\033" = "^o";
    };
    
  • There is the pesky >, as \033! Just remove the front one, and replace the end one with >, making it look something like this:

    NSUserKeyEquivalents = {
      "Johnny Appleseed <seedman@example.com>" = "^a";
      "Johnny Appleseed <johnny@example.org>" = "^o";
    };
    
  • Save the file, and you're set!

Note that if you go into System Preferences and change the shortcuts, it'll probably introduce the \033s again and you'll need to do the manual fix again.

Hope that saves people time!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.