For the few times I need to send a fax, I'm not going to mess with getting one of my broken third-party fax applications to run again. But the built-in OS X fax capability has some annoying limitations. One of the more annoying ones is that it doesn't save a copy of outgoing faxes. I wrote the following script as a kluge, to grab a copy of outgoing faxes and store them in /Users/Shared/Faxes/Outbox. The fax is saved (complete with the cover page) as a multi-page TIFF file.
!/bin/zsh
if [ $EUID -ne 0 ]; then
echo YOU MUST SUDO TO ROOT TO RUN THIS
exit
fi
dt=`date '+%Y%m%d-%H%M%S'`
t=''
echo Waiting for efax to run.
while [ x$t = x'' ]; do
t=`ps -ef|grep efax|grep -v grep`
sleep 1
done
ls -al /var/spool/cups/tmp
f=`echo $t|sed -e 's#.*\(/private.*\)#\1#'`
if [ -r $f ]; then
echo COPYING $f to /Users/Shared/Faxes/Outbox/$dt.tiff
cp $f /Users/Shared/Faxes/Outbox/$dt.tiff
sudo chmod a+r /Users/Shared/Faxes/Outbox/$dt.tiff
open /Users/Shared/Faxes/Outbox
else
echo file $f doesn\'t exist
exit
fi
echo If something goes wrong, try \"faxlog debug\"
tail -f /var/log/cups/error_logMac OS X Hints
http://hints.macworld.com/article.php?story=20081205225217399