I'd like to apply a quartz filter (Reduce File Size) through Preview Export using the command line while passing in the input and output filenames through CLI. I'm thinking the best way to do this is through Automator since it seems there isn't a way to access Preview through CLI.

I'm thinking it would look something like this in the end:

automator -i input=input.pdf output=output.pdf PDF.workflow

But I'm probably completely off.

Here's the basic workflow, which doesn't work as hoped:


1 Answer 1


MacOS (OSX) used to have a Terminal command quartzfilter, which would apply a Quartz Filter to PDFs and allow output names. Sadly, it was removed in Snow Leopard.

Here's a python script which works as a replacement.

The Automator action "Apply Quartz Filter to PDF Documents" applies the filter to the input, so your workflow copies the PDFs but then over-writes the originals with the Filter.

  • Is someone stalking me and downvoting all my answers? Any particular reason why this is bad?
    – benwiggy
    Dec 20, 2018 at 7:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .