How To Combine PDF Files in Mac OS X Using Automator To Make A Service

How To Combine PDF Files in Mac OS X Using Automator To Make A Service

Many scanners let you choose between scanning one-PDF-per-page or scanning all the pages into one big PDF. The scanner I use does.

However, what happens when you have multiple PDFs that really should go in one document? How do you combine PDFs together?

There are a million ways to do this, including some I have talked about before like using to drag and drop pages, and there are lots of applications that one can use to combine PDFs, but I wanted to do something that would be:

  • Already built into the OS and not require any additional software.
  • Easy to use.
  • Repeatable so I only have to set it up once and can use it again and again.

We’re going to use a Mac OS X tool called Automator to set this up. If you have seen my How to Split PDFs tutorial, this is basically the reverse.

Start Automator

In Finder, go to Applications and then start Automator.

Choose Service

In the window that pops up, highlight Service and then hit Choose.

Automator Choose Service

Automator Choose Service

Set The Variable For The Original PDFs

At the top of the window at the right, change the Service receives selected dropdown to PDF files. I set the in dropdown to I haven’t tested it in other applications.

Now in the Library section on the left, click on Utilities and then find Set Value of Variable. Drag it to the main window on the right.

Drag Automator

In the Variable dropdown, choose New variable… and call it originalPDFs.

Here’s what the first rule looks like so far.

Automator Get Variable

Set The Variable For The Path Of The PDF

We are doing this step because of a weird way Automator works. It doesn’t make it easy to save the resulting PDF to the same folder as the original.

I could prompt the user to choose a path, but I wanted to make it automatic so we have to get a bit geeky.

Note: if you’re an Automator expert and know a better way to do this, please leave a comment!

Still in the Utilities section of the Library on the left, find Run AppleScript. Drag it to the main window under our last step.

In the Run AppleScript window, paste in this code:

on run {input, parameters}
set pathList to {}
repeat with itemNum from 1 to count of input
tell application "System Events"
copy POSIX path of (container of (item itemNum of input)) to end of pathList
end tell
end repeat
return pathList
end run

(Basically that is going through the PDFs that you are splitting and copying the folders that they are stored in.)

Now in the Utilities section of the Library, find our old friend Set Value of Variable and (you guessed it) drag it into the main window under our last step.

In the Variable dropdown, choose New Variable… and give your new variable a name of containerPath.

Here’s what these steps look like:

Automator Get Path

Combine The PDFs

Now it’s time to do the combining!

First, we want to get the list of PDFs that we had saved back in the first step.

In Library -> Utilities, drag Get Value of Variable to the main window under our last step.

In the Variable dropdown, choose originalPDFs.

Right under the Variable dropdown there is an Options button. Hit that and check Ignore this action’s input.

Now in Library on the right, choose PDFs. Find Combine PDF Pages and drag it under the last step.

Next, in Library on the right, choose Files & Folders. Find Rename Finder Items and drag it under the last step. It will pop up a message asking you if you want to preserve an extra copy. We don’t need that, so hit Don’t Add.

In the Rename Finder Items box, change the dropdown to Name Single Item. Then hit the Options button and check Show this action when the workflow runs. This will let name the new PDF.

Next, also in Files & Folders, drag Move Finder Items under the last step. In the Variable window at the bottom of your screen, find your containerPath variable. Drag it up on top of the To dropdown.

Here is what those last steps look like:

Combine PDFs

Combine PDFs

Save The Service

Alright! You’re done! Here’s the entire rule (click to see it bigger):

Mac Combine Service

Go to File > Save and give your new service a name. I’ll call mine Combine PDFs.

Use The Combine PDFs Service

You have just created a Service. This means that if you right-click a group of PDFs in the Finder, you can combine them right from there. Let’s try it.

Find a group of PDFs on your Mac, highlight them, and right-click. Choose the Services menu near the bottom. If all went well, you should see Combine PDFs (or whatever you called your Service) in the list. Choose it.

Combine Mac Service Right-Click

Combine Mac Service Right-Click

It will think for a moment and then pop up a box where you can give the new PDF a name. I just called mine “Combined”.

Combine Mac PDF Give Name

Combine Mac PDF Give Name

Boom. I now have a PDF called Combined.pdf that contains all the selected PDFs.

Mac PDF Combined

Mac PDF Combined

Best of all, since I went through this trouble to set it up as a Service, going forward whenever I need to combine PDFs, I just have to right-click on them.

Downloading The Service

If you don’t want to go through the hassle of setting this all up, you are welcome to use mine.

To use it, download the file to your computer and double-click it to Unzip it.

You want to move the file to the ~/Library/Services folder. It’s probably hidden for you, so the easiest way to get there is:

  • Go to a Finder window
  • Choose the Go menu and then Go to Folder…
  • Type or paste in ~/Library/Services

Once that window opens up, drag the CombinePDF.workflow file there.

Click Here To Download

This article was originally written in August 2010. It was updated in September 2015 for OS X Yosemite and to improve the workflow.

About the Author

Brooks Duncan helps individuals and small businesses go paperless. He's been an accountant, a software developer, a manager in a very large corporation, and has run DocumentSnap since 2008. You can find Brooks on Twitter at @documentsnap or @brooksduncan. Thanks for stopping by.

Leave a Reply 93 comments

Brian Krans - November 17, 2015 Reply

Thank you so much for this. I tried replicating yours, but I’m entirely new to this. Used the version you had for download and it worked like a charm. Cheers!

Brenda - November 13, 2015 Reply

I went through all these steps. Ensured it matched yours, but it doesn’t show up in ‘services’ when I try to actually use it :(

Glenn - November 9, 2015 Reply


Is there a way to view Applescript coding for this automator task? I want to compile dozens of books, one after the other, basically using this process in the applescript program.

Mitzie - September 17, 2015 Reply

Combining the PDF’s with Automator is fantastic! Is there a way to do this combining .csv files created thru ScanReceipt? I’ve been trying to come up with an easier way to merg the .csv files I’ve created. I’m not comfortable scanning all my receipts into Scan Receipt and leaving them there until I’m ready to do my taxes. Thanks for any help you can give!

Jun - September 2, 2015 Reply

for me this is complicated

Cindy - May 21, 2015 Reply

Worked great! Thanks!

Gabor - April 6, 2015 Reply

Hi! Great idea! I am doing this right now! The problem I seem to have run into, is that it only works up to 1000 items. I am trying to merge a 1166 page book, that was scanned one page per pdf. Any ideas to increase the 1000 file merge limit? Thanks in advance!

    Ray - April 6, 2015 Reply

    Do two separate combinations of under 1000 pages (e.g., two 583 page combos), then merge your two new PDFs.

      JKJ - April 6, 2015 Reply

      I realised this solution after I submitted the comment :-). I was just surprised by the limit.

Summer - March 20, 2015 Reply

This is possibly the most helpful thing I’ve seen all week. SO MUCH TIME SAVED, YET SO EASY. I also had no idea about the Automator tool at all, so this was a really cool introduction to it. Thanks so much for this tutorial!

Joel - December 12, 2014 Reply

Doesn’t work for me in Yosemite.
No “save as”…. Rename saves to Icloud.
Selection of multip,e files in Finder shows no option for Combining PDF’s

    Joel - December 12, 2014 Reply

    I must be really tired….tried it again and it works!
    I ignored the “save as” and hit “save”. How anal am I? Just following directions

      Joel - December 12, 2014 Reply

      Many thanks. Now that nasty PC laptop can go away. I only kept it on my desk to deal with PDF’s

RF - December 7, 2014 Reply

Thanks a million!

One of the things I have been really missing since leaving Windows was a set of utilities called PDFill FREE PDF Tools, which I used mainly to merge PDFs. I knew you can do this using Preview, but, let’s face it, that’s kind of a pain. I teach, so I have to combine PDFs all the time. This was a great tip, and more importantly, I have learned a world of possible actions I can create using the amazing Automator, which I have used before, but I am much more familiar with now through your tutorial.

Many thanks to both you and George Harito.

Olivia - November 5, 2014 Reply

When I go to Finder, right click my documents, I have two combine PDF files options. They both are under different names. How do I delete one of them? Thanks.

Nick - October 7, 2014 Reply

Hey thanks this was a great solution.
Just a quick one (Didn’t seem to see this in thread…)

I am interleaving Simplex scanned pages with a second set of pages odds then evens.

To get correct interleaved of odd then even pages – I found that when I select the two original files the odd number file (I.e. the first page, third page 5th pages to-be) had to be the top file when selecting the two files in the finder. (This is when running the automator script)

I.e. just the top file as the files are displayed in the finer window. Even just reversing the alphabetical display of the files in as they are listed in the finder works if you happen to have named the one you want as the 1,3,5 pages with a alphabetical character later than the 2,4,6 file (Like Odd Filename : Even Filename)

Cleoni Crawford - August 30, 2014 Reply

You are a LIFE SAVER! I had spent hours trying to figure this out. Thank you for posting this. Virtual hug!

Rory Geraghty - April 23, 2014 Reply

Thanks a mil!!!

I had been going a ludicrously frustrating way about doing this before I found your article

    Brooks Duncan
    Brooks Duncan - April 23, 2014 Reply

    Great Rory, glad it helped!

      Vikki W - April 16, 2015 Reply

      I got it to combine the pdfs. The only problem is I lose the color and grayscale. Is there a way to fix this?

Wendy - March 25, 2014 Reply

Wow, this was so easy and it worked like a dream. Really saved me hours! Thank you for taking the time to post.

And, now I am intrigued by Automator – any other ideas for other things to automate?

Ana - March 12, 2014 Reply


Daphne - March 1, 2014 Reply

It worked!!!!! Nothing I do ever works, so I am a happy bunny… Yeah!

Thank you sooooo much.

If you know how to re-size the Pages my life will be complete…

Jeff Claassen - February 11, 2014 Reply

I just want to say thank you so much for posting this tutorial! It’s been a huge help for me. Thank you!

JMC - December 11, 2013 Reply

This just changed my life! I have never even heard of automator, and I just created a PDF Splitter & a service to combine PDFs. Thanks for the super easy-to-follow steps!

    Brooks Duncan
    Brooks Duncan - December 11, 2013 Reply

    Awesome JMC! There's definitely a lot of power on the Mac when it comes to automating stuff. Glad you're started down the path.

that one dude - October 15, 2013 Reply

This worked great. I can make any service i want now. Thank you, Thank you, Thank you!

Karen - July 27, 2013 Reply

Too easy – I just love it! thank you so much :-)

Daniel - July 14, 2013 Reply

Thanks so so much! Any tips for how integrating this into Alfred?

    Brooks Duncan
    Brooks Duncan - July 14, 2013 Reply

    Ohhh that would be tempting to figure out. I'll see what I can do someday. 

Joseph - July 12, 2013 Reply

Thank you! you saved my Friday!

Lisa H - May 16, 2013 Reply

This is a PERFECT walk-through to combine PDF files on my mac. Wow. Thank you x10000000!!!!

SpokaneDude - May 3, 2013 Reply

Fantastic! I didn't know such a thing (create Services with Automator) existed!

Thank you so much!

Greg - March 28, 2013 Reply

Fantastic tip!! Thank You!!

jay - March 19, 2013 Reply

It worked perfectly!!! Thanks a lot!!!!

    Brooks Duncan
    Brooks Duncan - March 19, 2013 Reply

    Awesome thanks for the report jay!

Mariyah - February 28, 2013 Reply

this helped me a lot.big thanks!

songssavelives - January 4, 2013 Reply

Thank you so much for this very helpful tutorial! I TA for a professor who doesn't understand technology and gives me 50 pages documents in individual .pdfs. This was a lifesaver.

Thomas - November 27, 2012 Reply

BIG UP!! Thank you very much for the help

JR3 - October 13, 2012 Reply

Worked great, thanks for the post!

Luca - October 6, 2012 Reply

I can't say how this help me a lot, thank you!!! : )

    Brooks Duncan
    Brooks Duncan - October 6, 2012 Reply

    Great thanks Luca!

LehsyaR - September 17, 2012 Reply

this only worked for me after where it says "Choose a template for your workflow" i chose APPLICATION instead of SERVICE, then i followed the rest of the steps as is.

Richard Bowen - August 13, 2012 Reply

If you also want to be given the option to automatically delete the original files have a look at this thread:

    Brooks Duncan
    Brooks Duncan - August 13, 2012 Reply

    Very cool, thanks Richard!

isatiila - August 1, 2012 Reply

Thanks for this, very clear and very helpful!

    Brooks Duncan
    Brooks Duncan - August 1, 2012 Reply

    No problem, thanks for your note!

Ben - July 19, 2012 Reply

This made my life so much easier. Thanks a lot!

    Brooks Duncan
    Brooks Duncan - July 19, 2012 Reply

    Awesome Ben, glad it helped!

A.Z - July 9, 2012 Reply

Thanks , useful .

Donato - June 21, 2012 Reply

Fantastic!! This is just awesome!

Kristi - June 13, 2012 Reply

I have been looking for a way to combine PDF's for over a week. And I just needed it for one 3 page file. Thanks so much for this tutorial! Only thing I found that works so far!!


    Brooks Duncan
    Brooks Duncan - June 13, 2012 Reply

    Yay Kristi, thanks for letting me know! <p style=”color: #A0A0A8;”>

DAVIDSDIEGO - June 2, 2012 Reply

This worked amazingly well, thanks!

    Brooks Duncan
    Brooks Duncan - June 2, 2012 Reply

    Glad it helped!<p style=”color: #A0A0A8;”>

Lori - May 18, 2012 Reply

This is awesome, thanks! Makes my life much easier. :)

Nish - November 30, 2011 Reply

thank you thank you thank you…….

    Brooks Duncan
    Brooks Duncan - November 30, 2011 Reply

    Glad it helped Nish! Thanks for letting me know.

Summer - October 11, 2011 Reply

Hey brooks great post! I'm trying to create a very similar automator script using the Folder Actions option, so that every time I add a new PDF (1page) to a certain folder it automatically combines with a certain PDF (2 page) doc, to make a 3 page PDF which I can then rename etc as above. The issue I'm having is it puts my 1 page doc in the middle of the other 2 pages, so its out of order. Any tips on setting this right?

David - October 11, 2011 Reply

great suggestion!

hubbub - September 9, 2011 Reply

I just discovered automator and solved my problem, thank you!

    Brooks Duncan
    Brooks Duncan - September 9, 2011 Reply

    Yay hubbub, thanks for letting me know!

technoed - July 17, 2011 Reply

Wow, thank you very much, exactly what I needed and did not have to pay Adobe for the privilege.

Harper - July 6, 2011 Reply


    Brooks Duncan
    Brooks Duncan - July 6, 2011 Reply

    Now that's the kind of comment I like. No problem Harper, glad it helped.

Scottie - June 30, 2011 Reply

That is awesome thankyou very much. Not being able to right-click and combine PDFs was one shortfall I have found with Apple. Now fixed, thanks.

    Brooks Duncan
    Brooks Duncan - June 30, 2011 Reply

    Great Scottie, so glad it helped!

Aubrey - May 24, 2011 Reply

Thank you very much for the very useful instructions! Saved so much time and effort. Thank you.

    Brooks Duncan
    Brooks Duncan - May 24, 2011 Reply

    Great thanks Aubrey glad it helped!

J Epstein - May 14, 2011 Reply

Embiggen is a perfectly cromulent word, and this is a superbly cromulent tutorial! Thanks for helping me try Automator, it's kinda cool. And my PDF files go into my new document in the correct order! All I had to do is sort by Date Modified! Oh happy day!



    Brooks Duncan
    Brooks Duncan - May 14, 2011 Reply

    I was waiting for someone to make a Simpsons reference! Glad it helped. :)

Batch PDF Merger - April 8, 2011 Reply

Like many Windows users, they have to resort to the 500 lb gorilla Adobe Acrobat. Luckily Mac users have this available to them if they are using Snow Leopard. Great post.

Brian - March 23, 2011 Reply

awesome. thanks!

    Brooks Duncan
    Brooks Duncan - March 30, 2011 Reply

    No problem Brian, glad it helped!

G.E. - December 24, 2010 Reply

Thank you so much. Very clearly explained and helpful.

    Brooks Duncan
    Brooks Duncan - December 24, 2010 Reply

    Thanks G.E.! Happy holidays!

Greg - December 6, 2010 Reply

Just want to say thanks, helped a lot, and learned a few things. Thanks for the post

    Brooks Duncan
    Brooks Duncan - December 6, 2010 Reply

    Thanks so much for your feedback Greg!

Merge PDF mac - December 3, 2010 Reply

This won't work on Tiger. I had to combine over 60 pdf files and I used Batch PDF Merger to do the trick. SImple, easy and best of all, I was able to arrange the files in any order…nice!

Hannah - November 9, 2010 Reply

This post is awesome and saved me about 2 hours of dragging and dropping… thank you!!

    Brooks Duncan
    Brooks Duncan - November 9, 2010 Reply

    Wow thanks so much Hannah. Glad it helped!

georgeharito - October 28, 2010 Reply

Hi Brooks,

Thanks for the link to my blog post about combining PDF documents. I must admit, at the time of writing it, I hadn't sorted out all the little issues with my workflow, so I can see how it may be confusing to read through and "play at home" so to speak for those who aren't confident with using Automator.

I'm glad my post inspired you, and it's great that you have taken the initiative to make things a little clearer.


    Brooks Duncan
    Brooks Duncan - October 28, 2010 Reply

    No worries George, it was a great post and thanks again.

Leave a Reply: