The tool.py you linked to made changes ("fixes") to the tool.py in the watermark action resource folder, but that should not be a problem.
While it ok to run that script in Automator, it won't show any errors generated by the py script
Save the script in TextEdit as a plain text file and in Terminal make it executable with chmod u+x, then drag the saved script to the Terminal window so you can see what the errors are.
The problem could be that the pdf's and/or png's have uppercase extensions (PDF, PNG), while the script is testing only for lowercase
This script will look for either upper or lower (change directories again to match yours):
#!/bin/bash
for f in $HOME/Documents/* # <-- Point to dir with PDF's
do
if [ "${f##*.}" = "pdf" -o "${f##*.}" = "PDF" ] ; then
basename="${f##*/}"
name="${basename%.*}"
pngfile="$HOME/Desktop/$name.png" # <-- Point to dir with Watermarks
if [ -f "$pngfile" ] ; then
/System/Library/Automator/Watermark\ PDF\ Documents.action/Contents/Resources/tool.py --under --xOffset 15 --yOffset 55 --angle 0 --scale 0.75 --opacity 0.5 --input "$f" --output "$HOME/Desktop/$name.pdf" "$pngfile"
else
pngfile="$HOME/Desktop/$name.PNG" # <-- Point to dir with Watermarks
if [ -f "$pngfile" ] ; then
/System/Library/Automator/Watermark\ PDF\ Documents.action/Contents/Resources/tool.py --under --xOffset 15 --yOffset 55 --angle 0 --scale 0.75 --opacity 0.5 --input "$f" --output "$HOME/Desktop/$name.pdf" "$pngfile"
else
echo PNG file not found for "$f"
fi
fi
fi
done