Yes, you can drive sam -d non-interactively. You can also give it more than one file name, so you could do
sam -d *.html <<'!'
X/./ {
... sam commands to munge the files ...
}
!
(modulo `changes out of order' complaints; in that case, issue
multiple X commands).
