Question

I have 50+ documents to print with the exact same printer settings and I'm trying to batch print them using the existing printer preset. What I've done so far:

  • open all documents in one preview windows on El Capitan -> doesn't work, prints all documents as one document instead of separate ones (e.g. if the documents have an odd number of pages, the next documents is printed on the back of the last page)
  • Try a python script to create a pdf made of all my needed documents in the right format, so that I could print it and separate the documents manually -> unsucessfull as my python skills are not that great + needs to be done again everytime the situation happens again.
  • change the cups settings and hit cmd+P in the finder -> doesn't work as I can't get the right margin settings in CUPS + the solution is not a long term one as one would need to tinker with CUPS every time a new batch job with different settings has to be done, eventually loosing the overview of what has changed.

In short, I would need the preview printing dialog batch applying to a bunch of documents or an applescript/automator etc. that can use existing printer preset (those must be stored somewhere in the system, I don't know where) and apply it to selected documents. Any idea?

System: 10.14 but I can use 10.11 if needed.

Was it helpful?

Solution 2

So based on previous comments and answers I settled for a bash script with a for loop:

#! /bin/bash

cd /path/to/your/PDFfiles
for pdffile in *.pdf; do
        lpr -P MY_PRINTER -o media=A4 -o sides=two-sided-long-edge -o InputSlot=tray-3 "$pdffile";
done

Beware that this script prints all pdfs in /path/to/your/PDFfiles ! A few useful commands to tailor this script to your needs:

  • lpstat -p lists all printers in your system and gets you the "CUPS name" (I guess it's called so?) of your printer
  • lpoptions -p MY_PRINTER -l lists the printer-specific options you can add with the -o option=xy option of the lpr command. The generic CUPS options (= for ± all compatible printers) are visible at https://www.cups.org/doc/options.html#OPTIONS

If you want so save this script: save it as batchprint.sh, make it executable with chmod a+x batchprint.sh and next time you drag and drop this script to a terminal window, it will do what you whish!

OTHER TIPS

There are a couple of things you can do:

  • Printer Presets

    Under the Presets menu, see if the Reset Presets Menu to “Default Settings” is checked. If this is checked, uncheck it and the last preset you used remain in place when you finish printing the document.

  • Create a "New" Printer

    Create a new printer that prints to the same device, but set all the printer defaults (printer presets) the way you like them. When you print, print to that printer instead. You can even temporarily set that printer as the "default printer." Just remember to set it back when you're done.

When you use Command P in the Finder, an image or PDF file will print using the default preset. You can configure a Print Preset as the default by saving it, then select it and hold Option when you click on Print.

In System Preferences > Printers, you can click on "Open Print Queue", and then you can drop files directly onto the Printer's queue window. This include PDFs but also other image formats natively handled by MacOS.

So the trick is configuring the print queue with the settings you want, which you can do from the CUPS web interface. You can then create as many print queues with different characteristics as you like. However, you seem to suggest that's not working for you.

You could also use the lp or lpr shell commands, with whatever options for your printer that you require. See the CUPS manual for details.

In AppleScript, it is possible to print with properties, but those don't seem to include device-specific options, nor presets.

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top