Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I often need to email a PDF of the document open in the front app.

Currently, I need to invoke the print command, then reach for the mouse to open the "PDF" menu in the system print dialog, and finally choose there "Mail PDF".

Is there any way I could set up a global keyboard shortcut that would trigger the mailing of the PDF directly?

share|improve this question

Under System Preferences » Keyboard » Keyboard Shortcuts, you can create a new Application Shortcut for all applications.

Call it "Mail PDF", and assign a custom keyboard shortcut, like ⌥⇧⌘P.

It is now available in the Print dialog:

To use it, press ⌘P from any application, then ⌥⇧⌘P. The only problem with this approach is that the "PDF" menu needs to be selected. I've found this to work inconsistently, so have others.

For another approach, open, create a new Service. Set it to receive "no input" and add the "Run AppleScript" action from the library to the right panel.

Paste the following:

tell application "System Events"
    set theName to name of the first process whose frontmost is true
    tell process theName
        click menu item "Print…" of menu 1 of menu bar item "File" of menu bar 1
        click menu button "PDF" of sheet 1 of window 1
        click menu item "Mail PDF" of menu 1 of menu button "PDF" of sheet 1 of window 1
    end tell
end tell

Save it, then go to System Preferences » Keyboard » Keyboard Shortcuts, and go to Services. Here, assign a keyboard shortcut for your new service.

This works for most applications, but not all of them. I might find a way to debug why it fails, but I guess it depends on how the print dialog is implemented.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .