OSX service (10.6.8) for merging PDF files

Discussion in 'macOS' started by macstatic, Aug 13, 2013.

  1. macstatic macrumors 6502a

    Joined:
    Oct 21, 2005
    #1
    In the quest for a quick way to combine several PDF files into one I came across this page on how to use Automator to create a right-clickable OSX service for this.

    Very quick indeed, but doesn't do exactly what I need. If possible, how do I modify it (or do the whole thing another way) so that:

    1) I can select the order of the individual files before saving
    2) The new file is saved in the same folder as the individual files
    3) Give the new file a name which is based on one of the individual files (i.e. the basename with "merged" appended might be a good start)

    I'm in OSX 10.6.8.
     
  2. benwiggy macrumors 68020

    Joined:
    Jun 15, 2012
    #2
    That's going to require a fairly hefty bit of AppleScript (or other code) to achieve.
    As for some sort of interface to sort the order of the items, while the Service is running: that's a pretty serious task in itself.
    You may get someone to provide you with a big load of code here -- you could also try some of the AppleScript forums.

    Automator is fantastic at doing a succession of tasks, but as soon as you want to include conditional logic and passing variables, then you need code.

    Perhaps if you give more detail of the overall process, there may be another method.

    But you might find it simpler to try one of the many cheap utility apps that do this kind of thing.

    It's also worth pointing out that the original need in the linked article -- combining scanned pages into one PDF -- can be achieved in Image Capture. There's a setting to add the current scan to an existing PDF file. I don't know whether this is in 10.6, but it's certainly in 10.8.
     
  3. macstatic thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #3
    I guess I can do without previewing/sorting the PDFs but instead do a Quickview (space-bar) of each PDF, then rename the filenames with say a number at the beginning, so Automator will know in which order they should be added. That would simplify it a bit.
    Automatically adding a filename would be nice, but also something I can do without.
    However, saving the new (merged) PDF file in the same folder as the original would save me some addtional clicking. I read about how Automator's "Duplicate Finder Items" could solve this here but haven't been able to get it to work myself. How should I modify the existing Automator script with this feature?

    PS: I had a look at Image Capture, but couldn't find what you mentioned. But I assume it only works when actually scanning. What I want to achieve is for PDF pages I already have.
     
  4. mmomega macrumors demi-god

    mmomega

    Joined:
    Dec 30, 2009
    Location:
    DFW, TX
    #4
    I have a PDF combiner I made quite a while back when I had the same problem.
    All you have to do is have the script on the desktop and select all the PDF's and drop them onto the script, out pops a PDF booklet.

    Hope it works for you, had to compress the file in order to add to attachments.
     

    Attached Files:

  5. macstatic, Aug 18, 2013
    Last edited: Aug 18, 2013

    macstatic thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #5
    Thanks!
    I think I'll add both scripts to OSX's services as the first one is quickest if the order of PDFs is correct to begin with while yours is better for rearranging PDFs first.

    I tried opening it in Automator (so I can save it as a Service) but got the following error message:
    "The workflow was saved with an older version of the action.... some behaviour may have changed."

    This is what your script looks like here, after opening it in Automator.
    In case it's different at your end, would you mind posting a screenshot so I can recreate it correctly?
    [​IMG]
     
  6. macstatic, Aug 18, 2013
    Last edited: Aug 26, 2013

    macstatic thread starter macrumors 6502a

    Joined:
    Oct 21, 2005
    #6
    Both scripts work pretty well (I did figure out that the last step should be "Move Finder Items" though, not to trash as above), but.....
    I've noticed that annotations in the PDFs are all lost. I believe I might need to change the last step ("Move Finder items" to the equivalent of Preview's "File"-"Print selected pages" followed by "PDF"-"Save as PDF".
    In Automator I did find "Utilities"-"Print Finder Items", but it doesn't seem to do the above. Suggestions anyone?
     

Share This Page