Simple Print Server using Automator and Dropbox

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
IntroductionI was recently reading this article on Ars Technica about Google Cloud Print and was inspired by the second last sentence:
Or, if you're a Dropbox user on OS X and feel more comfortable setting things up yourself, you can use Automator to automatically print any file synced to a local Dropbox folder.

I wanted to see how well this would work and after doing some quick work in Automator along with some simple testing, I found an easy way to set up a "print server" ... ... Return to article to continue reading.
 
Joined
Oct 22, 2007
Messages
8,967
Reaction score
287
Points
83
Location
London
Your Mac's Specs
Mac Mini Core i7 2012 | White 2009 MacBook 2 Ghz | 733 Mhz G4 Quicksilver
Is there any way to setup 2 folders, say one for A4 and one for A3?
 

Slydude

Well-known member
Staff member
Moderator
Joined
Nov 15, 2009
Messages
17,609
Reaction score
1,076
Points
113
Location
North Louisiana, USA
Your Mac's Specs
M1 MacMini 16 GB - Ventura, iPhone 14 Pro Max, 2015 iMac 16 GB Monterey
The only way I can think of to have more than one of these active is to have one folder in Dropbox for each of the sizes that you want to print (A3, A4, legal, etc). Build the automator workflow and assign it to each of those folders then follow the directions Van outlined.

That should work though I have not configured Dropbox to test it yet.

Nice job Van. Now you've got me wondering what else I can do with Dropbox.
 
OP
vansmith

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
I doubt it's possible with Automator actions. Automator's printing functionality is rather limited in that it prints the document or it doesn't. Even the MS Word print action for Automator only offers up a few options (number of copies, collating and print ranges).

Now, you could use command line tools to do this. Setup two folders - one for A4 and one for A3. Let's do the A4 printing first.

For the A4 folder, instead of a print action, create a "Run Shell Script" action. To get the proper command, you'll have to get your printer name first. To do that, open up a Terminal and execute the following:
Code:
lpstat -a
That will list your printers. I get the following:
Code:
Canon_MP210_series accepting requests since Sun 20 May 12:34:00 2012
PTO_Office_Printer accepting requests since Tue  3 Apr 15:09:41 2012
uOttawa_Printer accepting requests since Thu 25 Aug 11:03:30 2011
The name is the first part of each line (Canon_MP210_series, PTO_Office_Printer and uOttawa_Printer). Remember the name of the printer you want to use.

Back to Automator. As the value for your shell script, enter the following:
Code:
lp -d “<PRINTER NAME>” -o media=A4 "$@"
Replace <PRINTER NAME> with the appropriate value. As you can see, this is for the A4 folder (the media=A4 bit). The "$@" part is used in getting the name of the file that was recently added. You need to get this because the name of the file that is dropped into the folder has to be stored in memory temporarily. This is where we are going to set and get the value of what are called variables (simply put, they're like temporary post-it notes in memory that store content).

A picture truly is worth a 1,000 words and I think a picture will make this more clear. Here's a picture of how I think this might need to be setup for an A4 folder (again, you'll need to replace the printer name):

Screen Shot 2012-05-20 at 4.30.54 PM.jpg

Now, this is a theory - I haven't got any paper at the moment so I'll leave it up to you to test. If that works as I think it should, once the file is dropped in, the name of the file should be added to memory, retrieved and passed to the command. Let us know how it works! If that works, we can modify it for the A3.
 
Joined
Mar 16, 2013
Messages
1
Reaction score
0
Points
1
Help

Hey,

I have tried all of these but can't seem to get any to work. It keeps saying Workflow Failed or Warning. I am new to Macs so don't know if it is just something really simple I'm missing.

I have everything set up so that when a photo is tagged with my specific tag it is uploaded to my dropbox automatically. I was then hoping to link it so that the newly added files in my dropbox were printed automatically (at 10x15 size if possible).

Can anybody please help me with this? It's for a University project for my final degree and I need to sort this out to progress with my project.

Thanks,

Mike
 
OP
vansmith

vansmith

Senior Member
Joined
Oct 19, 2008
Messages
19,924
Reaction score
559
Points
113
Location
Queensland
Your Mac's Specs
Mini (2014, 2018, 2020), MBA (2020), iPad Pro (2018), iPhone 13 Pro Max, Watch (S6)
Can you post your workflow? What errors and warnings were you getting?
 
Joined
Apr 20, 2009
Messages
4,301
Reaction score
124
Points
63
Location
The lonely planet
Your Mac's Specs
Too many...
Thanks for this tip! Worked flawlessly!
 
Joined
Jan 23, 2016
Messages
2
Reaction score
1
Points
3
Thanks Vansmith! This works perfectly!

I'd been using GoToMyPC to connect to the office computer from home and to print reports to my home printer.

When my PC died I replaced it with an iMac. Then I learned that GoToMyPC cannot print while connected with a Mac so I was shopping for a Windows PC. At the same time I'd been listening to Mac Power Users podcast that mentioned Automator. I did some googling and came across your tip. I'm so glad I don't have to use Windows at home again. This really saved me!

There is no difference in the speed at which this prints compared to printing with the GoToMyPC print driver from my PC that died.

Great tip!
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top