Python script to use http://scanbuttond.sourceforge.net/ to scan documents headlessly.
Needs http://pybrary.net/pyPdf/ and the python-imaging-sane modules, as it comes with today's distributions.
See https://github.com/emeusel/scanbuttonpressed/blob/master/buttonpressed.sh.example for an example invokation script.