At my workplace, I am unable to find a printer driver for macOS which works with the printer. Instead, I'm printing through the web-interface of the printer, and I'm wondering if there's a way to automize this.

The steps I do manually that I want to automize (all or some):

  1. Save document as .ps (works better than .pdf for this printer)
  2. Go to the web address and log in to the printer
  3. Drag the file I want to the browser UI

Writing a script to simulate the web login and transmission of the file is a separate problem which I think I can solve.

My question: Can I use this custom script (probably Pyhton) as a "printer driver" to make it show up in the list of printers and enable me to print using cmd-p? It would have to automatically save as .ps and then do the webb stuff.


You don't need to create a "driver" as the functionality you need is already available. From the normal Print (CMD+P) dialog window, in the lower left corner, click on the PDF drop-down menu and choose the Save as PostScript option to save the "print" as a .ps file. (This part may have been your step #1 but I wasn't sure how you were saving the page as .ps)

Print Dialog:PDF Menu

Using a macro/script utility like Hazel, Keyboard Maestro, Automator, etc., they could be configured to monitor a specific folder where you save the .ps file. When a new file appears, the macro/script could trigger to send the file to the printer.

Also, depending on the printer model, it is likely the script could send the .ps file directly to the printer using a port/interface designed for a script/stream instead of using the web GUI. IPP/LPD/socket interfaces are designed for exactly this. Most likely the web GUI is using a javascript to grab the file from you then pass it into one of these interfaces.

P.S. Notice that in the screenshot, the "Save as PDF" option has a CMD+S shortcut. I created that by using the Keyboard Preference Pane in System Preferences. If you want to do the same but for the "Save as PostScript" option... Open the Keyboard Preference, switch to Shortcuts, select App Shortcuts on the left then click the [+] icon below. Set the shortcut for All Applications, Menu Title of "Save as PostScript...", and the Shortcut as CMD+S. You can use CMD+S because the normal shortcut for CMD+S (File>Save) is not available when the Print dialog is shown. Another good shortcut is CMD+P for the same reason. That way you press CMD+P, wait a second for the dialog to appear, then press CMD+P again.

  • Thank you for a very interesting answer! I do save the file as .ps exactly as you described, but I did not think of triggering the script upon the save, which is a brilliant idea since the number of steps is the same as a normal print. I'll definitely look into this. Also thanks for the short command idéa! I use save as pdf/ps a LOT so this is really helpful. An additional question, can I set the default .ps-folder (which will be static) to differ from .pdf (which depends on content)? – MartinSuecia Jan 4 '17 at 16:41
  • When you save either .ps or .pdf, it simply shows you the normal Save dialog window. It will probably default to your Home folder, Documents folder, or last used folder. If it is still around and working under the latest macOS, you could use something like DefaultFolderX which allows you to set the default folder view based on the application or file type. – Insomniac Software Jan 4 '17 at 19:56

You must log in to answer this question.

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