Simple Print Server using Automator and Dropbox

Introduction
I 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” using Dropbox and Automator (the quotations are purposive since this isn’t really a print server in the traditional sense).

Goal
By the end of this article, you will have set up a folder action for a Dropbox folder such that anything added to it will be printed. With this set up, you’ll be able to print documents from anywhere in the world and/or print content from mobile devices that are supported by Dropbox. With that said, let’s get started!

Automator
Open up Automator and create a “Folder Action.” In the window that appears, you’ll need to choose the folder that you want to serve as the directory that will house the content that will be printed (remember, this has to be in your Dropbox folder).

There is only one action that you need to add here: the “Print Finder Items” action. Add that and you’re done. Your final automation should look something like the following:

Save it and give it a name. Once this is done, your “print server” is ready to go. Give it a try – add a document to the folder you set to watch above. Wait for the file to sync over and once that’s done, the file should start printing (it will take a few seconds for the file to start printing).

Example Scenario
Let’s say that someone emailed you a PDF and you got the email on your iPod Touch/iPhone/iPad. You’d love to print it without having to go over to your computer but you don’t have an AirPrint capable printer. This is the perfect time to use your Dropbox/Folder Action solution.

Open up the email that you received:

Click on the attachment:

 Once the attachment is open, click the export button in the top right to get the following:

 Click the “Open in…” button and you’ll see something similar to the following:

Select the Dropbox option and Dropbox will open. Select the folder (in my case, it’s called “Print”) and upload the attachment:

Give the attachment a few seconds (or minutes) to upload the file to Dropbox and download onto your Mac. Once that is complete, the folder action will execute and the file should start printing.

That’s it! Enjoy printing from any mobile device that works with Dropbox or from any computer that is linked to your Dropbox account.

 

 

 

 

 

 

6 Comments: 

  1. louishen's Avatar
    Is there any way to setup 2 folders, say one for A4 and one for A3?
  2. Slydude's Avatar
    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.
  3. vansmith's Avatar
    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:That will list your printers. I get the following: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: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):

    17372

    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.
  4. MikeSkillings's Avatar
    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
  5. vansmith's Avatar
    Can you post your workflow? What errors and warnings were you getting?
  6. iggibar's Avatar
    Thanks for this tip! Worked flawlessly!
Leave a Comment