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.

How could I create a key shortcut in OS X Lion so when I am using Safari, I type these keys and inmediately a "New Message" window from Mail.app shows up?

share|improve this question
add comment

2 Answers

up vote 4 down vote accepted

You have several options how to do this without third party software.


The easiest way is to create a Service in Automator:

Open Automator, create a new Service that receives no input in any application and add a single New Mail Message action. Customize some field (e.g. recipient) you want to set default values for.

Save as any name, and it's available in every application's Services menu. Assign a keyboard shortcut in System Preferences » Keyboard » Keyboard Shortcuts » Services.

enter image description here


Another options is AppleScript:

tell application "Mail"
    activate
    make new outgoing message with properties {visible:true}
end tell

This uses Mail's API that behaves slightly differently than the UI in Lion with full-screen mode. You have most flexibility using AppleScript if you have additional requirements, but it's more difficult.

Open Automator like described above, and create a Service with a single Run AppleScript action. Paste the code into its text box.


The Services menu already has several services related to email by default, you just need to assign keyboard shortcuts:

  • New Email To Address (when an email address in text is selected)
  • New Email With Attachment (when a file is selected)
  • New Email With Selection (when some text is selected)

If you use an application launcher such as Quicksilver, LaunchBar, or Alfred, they might have this functionality already. For example, in LaunchBar, it's called New Mail Message.

share|improve this answer
add comment

Alfred (with the Powerpack) provides an easy way to assign shortcuts to scripts as well:

share|improve this answer
add comment

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.