AUTOMATOR – Print Finder Item on A3 stock

Can I setup a way to (automatically) select the paper stock size of a hot folder in Automator or by a native Mac script? The workflow has been setup correctly and prints any file that is exported into the folder I have specified... except it prints in A4.


I want to print every file that is copied into this folder on A3 paper.

iMac Pro

Posted on Jan 15, 2020 3:48 PM

Reply
Question marked as Top-ranking reply

Posted on Jan 16, 2020 5:54 AM

If you are using CUPS to print from a command-line in your Automator solution, you will have to send it a custom media option representing A3, as that size is not otherwise known:


lp -d printername -o media=Custom.297x420mm filename


There are several lpoptions to choose from in this lpoptions overview.

Similar questions

7 replies

Jan 20, 2020 9:24 AM in response to Kalan Howse

In the Terminal application, enter the following with a return afterward. This will show the default, and other printers with underscores replacing any white space in the printer names:

lpstat -d -p
system default destination: Samsung_ML_2950_Series__Sammy_
printer Samsung_ML_2950_Series__Sammy_ is idle.  enabled since Mon Jan 20 12:10:20 2020


This shows my Samsung laser printer name. In the following Automator Folder Action, replace my Samsung printer name with the name that you want to use from the above command output. This was tested and works on Mojave 10.14.6.


The following workflow initially filters the dropped file as being a non-zero PDF, and then sends it off to what will be your printer as an A3 (297x240mm) based on your A4 input PDF which is represented by the $f variable. You can use or omit the lpoptions from that link that I provided earlier if you need other optional print submission features.


Provided the print is successful, the script will then remove the PDF from the drop folder.





Jan 21, 2020 2:14 PM in response to Kalan Howse

You are welcome.


When you drop multiple PDF onto the Folder Action, these are passed into the Run Shell Script as a list ("$@) of arguments which represent the individual PDF documents.


That for-loop basically suggests that it is assigning the first PDF from "$@" to the variable f; enters the loop; sends the PDF file associated with the f variable to the printer, and then tests to see if the return code ($?) value from the lp command is zero — which indicates success. If it is successful, it proceeds to remove the current PDF that was just printed from the Drop Folder. It then loops, and if there was more than one PDF dropped, it assigns the next one from "$@" to the variable f, and this paragraph repeats itself until no more PDF files are found to process.

Jan 19, 2020 1:09 PM in response to VikingOSX

Thanks for your response.


Do you mind helping me out with sending the command-line action with my Automator Folder Action?


This is what it looks like now.



Do I run AppleScript or Shell Script? I have pretty limited knowledge in what's needed though I do understand what some of those lpoptions could do just not which program.


I would of course insert the custom code before the "Trash" sequence.

Jan 19, 2020 3:10 PM in response to Kalan Howse

Something you should know. Printing a PDF from Acrobat Reader DC, or Preview to your DocuCentre will look more refined, and closer to the original PDF text size — than submitting a print job from the command-line lp printing syntax to the same printer.


Is it your goal to properly rescale a letter, or A4 PDF down to an A3 document before sending to your DocuCentre?



Jan 19, 2020 11:24 PM in response to VikingOSX

TL;DR Yes, I would like my PDF to print on a larger sheet than A4.


I can maybe go into some detail as to why and what I am trying to achieve.


One of the programs I use at work (Prepress) requires a printer to utilise Postscript 3... the only problem is that it doesn't support anything other than PCL6. (*even though Fuji Xerox support pages say it supports it their technicians haven't been very helpful).


So in order to achieve what I need I have to setup a hot folder where my software (Kodak Workshop) outputs a PDF of a press sheet to a drop folder which is automated to print from my Mac to the printer.


This process is fairly straight forward. To make it easy to see the sheet and fold it up it's preferred to be on A3 stock (larger than A4). Fortunately this is only really occurs 3-5 times a month and ISN'T our main operation. We have 2 larger graphic printers to do our proper proofing on.


The only assistance that I really need is my initial forum question, I've got the rest of what is written above covered.


Thanks for your help Viking. :)

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.

AUTOMATOR – Print Finder Item on A3 stock

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