Merge PDFs Natively With A Right-Click In OS X

UPDATE 2020-05-23: I removed the Get selected Finder items, which was causing duplicates (see comments). I also updated it with screenshots from macOS Catalina. I updated the post to reflect all these changes.
UPDATE: If you installed this script today (2016-08-15), you may need to update it. I added a line in the script that should prevent duplicate pages from being appended.
There are plenty of apps that help you merge PDFs into a single file, but if you want something faster with a “native” feel, you can set up an OS X service to quickly merge selected PDFs simply by right-clicking them.

Setting It Up
First, open Terminal an enter this command to install the Python module that makes this possible:
sudo easy_install PyPDF2
Open Automator and choose Service

If you're on a more recent OS, Service has been replaced with Quick Action.

Search for script, drag Run Shell Script over. Using the pulldown menus, choose /usr/bin/python for the Shell: and as arguments for Pass input:


Paste in the script below.


Finally, save the workflow as Merge PDFs and it will become available in your right-click menu when using the Finder.


I have found this to be especially useful for when I need to submit a form with an attached document such as when submitting medical reimbursements or other medical requests.