Hello Tony! I have the same problem, and I followed everything from your post of November the 16th where you say to change line 29, add a line after line 75, and execute the file.
My files are:
~/Desktop/tool.py
~/Desktop/input.PDF
~/Desktop/watermark.jpg
I did the check with ~/Desktop/tool.py -h which seems fine. In Automater I removed the unnecessary spaces:
~/Desktop/tool.py \
--under \
--xOffset 0.7 \
--yOffset -5 \
--angle 0 \
--scale 0.24 \
--opacity 1 \
--input "$1" \
--output "${1%.*} (COPY).${1##*.}" \
~/Desktop/watermark.jpg
But that gives me the traceback error. And if I run it in Terminal with ~/Desktop/tool.py --input ~Desktop/input.PDF --output ~/Desktop/WaterMarked.pdf ~/Desktop/watermark.jpg I get the following:
['/Users/home/Desktop/tool.py', '--input', '~Desktop/input.PDF', '--output', '/Users/home/Desktop/WaterMarked.pdf', '/Users/home/Desktop/watermark.jpg']
--input ~Desktop/input.PDF
--output /Users/home/Desktop/WaterMarked.pdf
Traceback (most recent call last):
File "/Users/home/Desktop/tool.py", line 140, in <module>
main(sys.argv[1:])
File "/Users/home/Desktop/tool.py", line 131, in main
watermark(readFilename, args, writeFilename, under, xOffset, yOffset, angle, scale, opacity, verbose);
File "/Users/home/Desktop/tool.py", line 40, in watermark
images = map(createImage, watermarkFiles)
File "/Users/home/Desktop/tool.py", line 30, in createImage
if provider:
NameError: global name 'provider' is not defined
MacBook-Pro-3:~ home$
On December the 4th however, you say to add a code after line 32. But that gives me the following:
['/Users/artnaz/Desktop/tool.py', '--input', '~Desktop/input.PDF', '--output', '/Users/artnaz/Desktop/WaterMarked.pdf', '/Users/artnaz/Desktop/watermark.jpg']
--input ~Desktop/input.PDF
--output /Users/home/Desktop/WaterMarked.pdf
Traceback (most recent call last):
File "/Users/home/Desktop/tool.py", line 141, in <module>
main(sys.argv[1:])
File "/Users/home/Desktop/tool.py", line 132, in main
watermark(readFilename, args, writeFilename, under, xOffset, yOffset, angle, scale, opacity, verbose);
File "/Users/home/Desktop/tool.py", line 41, in watermark
images = map(createImage, watermarkFiles)
File "/Users/home/Desktop/tool.py", line 30, in createImage
if provider:
UnboundLocalError: local variable 'provider' referenced before assignment
MacBook-Pro-3:~ artnaz$
Could you please help? It would be highly appreciated! Thanks!