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.

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
add comment

1 Answer

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 Automator.app, 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
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.