The world’s simplest print queue

On my list of things I can’t get working is printer sharing from my Windows laptop to my Samsung ML 1740 laser printer attached to my Mac at home. Another item on the list is getting samba file sharing working from outside my router. It works fine inside my network though. I also have a handy little free utility called CutePDF installed, which allows me to “print” to a PDF file.

Combine those and I can create the world’s simplest print queue. When I want to print from my laptop, I print to a PDF and just save that file to a special directory on my Mac. Every minute, a tiny little script runs via cron and checks the directory for files. If it finds any, it sends them to the printer and moves the file to the “done” directory. I love it.

Here’s the script:


#!/bin/tcsh
cd ~/printme/
foreach f (`find . -type f -maxdepth 1`)
lpr $f;
mv -f $f done/
end

Leave a Reply

Your email address will not be published. Required fields are marked *