Does automator still work in macOS 12?

I followed instructions here: https://www.orbitsit.co.uk/2013/06/combining-pdfs-using-automator/

but it doesn’t work. The resulting error is:

The action “Combine PDF Pages” encountered an error: “The operation couldn’t be completed. Command line tool returned error 127.: 127”


I'm running macOS 12.6.9.


Is it possible to automate this task, both to join/combine and to split pdf files? If Automator doesn't work any more, is there a replacement?


TIA


pqb

MacBook Pro 15″, OS X 10.11

Posted on Oct 19, 2023 8:56 AM

Reply
Question marked as Top-ranking reply

Posted on Oct 21, 2023 7:57 AM

Apple removed all Python 2.7.* distribution from Monterey 12.3 onward and forgot that the Automator Combine PDF action depended upon the availability of an Apple System Python 2 by using a Python Script in that action. This cannot be fixed by installing Python from Python.org.


Apple includes a Quick Action with Monterey named Create PDF. In the Finder, you press and hold the ⌘-key while clicking the PDFs in the order of preferred combination. Right-click the first of this selection and from the Quick Actions submenu, choose Create PDF. A new PDF will be created using the name of the first selected PDF and since it already exists, Finder will append a 2 to the base PDF filename. You then rename it.


The Create PDF Quick Action has no PDF split capability. If you still need that, there are alternatives.



Similar questions

24 replies
Question marked as Top-ranking reply

Oct 21, 2023 7:57 AM in response to Peter Blackburn

Apple removed all Python 2.7.* distribution from Monterey 12.3 onward and forgot that the Automator Combine PDF action depended upon the availability of an Apple System Python 2 by using a Python Script in that action. This cannot be fixed by installing Python from Python.org.


Apple includes a Quick Action with Monterey named Create PDF. In the Finder, you press and hold the ⌘-key while clicking the PDFs in the order of preferred combination. Right-click the first of this selection and from the Quick Actions submenu, choose Create PDF. A new PDF will be created using the name of the first selected PDF and since it already exists, Finder will append a 2 to the base PDF filename. You then rename it.


The Create PDF Quick Action has no PDF split capability. If you still need that, there are alternatives.



Oct 21, 2023 7:41 AM in response to Peter Blackburn

I just did this in Automator. It worked perfectly.


  1. Ask for Finder Items
  2. Combine PDF Pages
  3. Move Finder Items


Alternatively, in the Finder, you could just select the PDFs that you want to combine, Control-click them, then select Quick Actions > Create PDF. This is even faster than running an Automator action.


And if you haven't done it yet, please try this with 2-3 PDFs that were not created by Word. That's to confirm or eliminate the possibility of the problem being with PDFs created by Word.



Oct 23, 2023 8:59 AM in response to Peter Blackburn

Luis Sequeira1 provided you with a Shortcuts solution that combines PDFs, just as the operating system Combine PDF Quick Action does already.


Here is a Split PDF Pages Shortcut (as a Quick Action) that I have tested on macOS Monterey 12.7 and Sonoma 14.0. The Shortcuts Split PDF action kicks out PDF pages with single-digit, zero-based suffixes, and my solution uses a 1-based, 3-digit suffix instead. I have hardcoded the output folder to be on the Desktop as PDF.




and the Run Shell Script code, so you won't have to retype it:


# left zero pad 3-digits
typeset -Z3 pageno
PDF="${HOME}/Desktop/PDF"

# capture () the basename of the PDF page and its n suffix
# the PDF page name is ${1} from the arguments
# the capture groups are in ${match} and 1 based.
[[ "${1:t}" =~ "(.*)-([0-9]*)\.pdf" ]]

# ensure we received two matches
[[ "${#match[@]}" == 2 ]] || exit 1

# Ternary if. Add 1 to Split PDF counter as it is zero-based
# if we don't do this, the pages arrive unordered
pageno="$(( ${match[2]} != 0 ? ${match[2]} + 1 : 1 ))"

# rename PDF page from System location to designated folder
/bin/mv "${1:a}" "${PDF}/${match[1]}_${pageno}.${1:e}"



Oct 21, 2023 8:35 AM in response to Peter Blackburn

Peter Blackburn wrote:

I followed instructions here: https://www.orbitsit.co.uk/2013/06/combining-pdfs-using-automator/
but it doesn’t work.

Check the URL. 2013. It's over ten years old.

Is it possible to automate this task, both to join/combine and to split pdf files? If Automator doesn't work any more, is there a replacement?

Obviously Automator still works. I can't say if it is possible to automate this particular task using built-in tools. Generally speaking, Apple doesn't support any automation and never has. AppleScript, Automator, and Shortcuts are useful to make certain tasks less repetitive, but it really isn't, and hasn't ever been, true automation.


My recommendation would be to look for a tool that will perform this task. You might find one on the Mac App Store. I assume Adobe could do it. You'll have to pay for all of these, perhaps a lot. If you want freebies, you'll have to look for open-source tools. There are plenty of them, but with a search phrase like "pdf", good luck finding one. I know of a few, but they have significant technical assumptions and I don't know what your background is like. If you know how to use these tools, then you know how to find them. If not, then you'll have to pay. There might be some easy-to-use, free tool that offers everything. But I don't know of it. That doesn't mean it doesn't exist, just that I don't know it. Even the search is something you'll probably have to do yourself.

Oct 23, 2023 4:14 AM in response to Peter Blackburn

The following shortcut done in the Shortcuts application is working for me. It works from the the Quick Actions contextual menu, and of course a keyboard shortcut for it can be added, directly on the same screen in the Shortcuts application.


Note: I am running Sonoma, I can't test this on Monterey anymore, but it is simple enough to test and see if it works. It is possible that the actions have been fixed in Ventura or Sonoma, though.




Oct 25, 2023 5:58 AM in response to Peter Blackburn

As I mentioned, yes, the Split PDF action alone does its job and generates foo-0.pdf, foo-1.pdf ... foo-*.pdf. If you are ok with zero-based split sequence naming, then all you need to do is move the files from the Shortcuts System temporary location to an existing folder of your choosing (e.g. ~/Desktop/PDF) and skip the Run Shell Script:



This works fine on Sonoma 14.0.


For that script error you received with the Run Shell Script, it makes me question if you had created the Desktop PDF folder before you ran the script? The same code worked fine here when that folder pre-existed.

Oct 31, 2023 6:13 AM in response to Peter Blackburn

The Shortcut that I posted on Oct 25 still works on Sonoma 14.1 when I right-click a 4-page PDF on my Desktop and choose that Shortcut as a Quick Action. I selected the PDF folder on my Desktop in the Move action, and all four pages are split into that folder location.


Just tested it with a 23-page PDF and it instantaneously wrote 23 PDF pages to my PDF folder.

Oct 23, 2023 2:17 AM in response to VikingOSX

Thank you for the reply.


It is slightly cumbersome compared with the simple service that was so convenient. Splitting into separate files is also very useful for me. Both service functions not do not work in current macOS? (I wonder if Windows, or even better, Linux has an easy way of doing this). Apple are shooting themselves in the foot when they break useful features like this.


Many thanks also for other replies with suggestions. I’m really looking for a straightforward solution for a simple user, who has a day of work to get through.


pqb



Oct 25, 2023 3:56 AM in response to VikingOSX

Thank you very much, VikingOSX.


Without the script it splits a pdf into individual pages, as required.


This seems to work for what I need.


With the script I get an error:


The script would make the files have numbers 000 through to a maximum of 999, if I understand correctly.


What I get without the script would put the files out of order, as 10 would come after 1, for example. However I think that A Better Finder Rename is able to solve that.


pqb



Nov 1, 2023 5:45 AM in response to VikingOSX

I'm still getting the error. Now upgraded to Sonoma 14.1. Using the version without the script splits the pdf naming the individual files filename-0 and past 10 numbers are still in order.


Could you tell me what the script does that is different? There seems no point in troubling you and others further if the short cut works for what I need.


Many thanks again.


pqb



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Does automator still work in macOS 12?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.