Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Automator: Watermark PDF Documents not working

Hi,


The "Watermark PDF Documents" action of Automator is not working.


No matter which files you choose, and I tested a lot of combinations, the action ends up with the following error:


"Watermark PDF Watermark failed - 1 error"

"Command line tool returned error 1. (1)"


User uploaded file


I have a clean Install of Yosemite. I tested with 2 more Mac Book Pro's with Yosemite and the same happen.


To replicate you just have to create a new Automator, with 2 actions:

- Get Specified Finder Items, and choose a PDF file

- Watermark PDF Documents, and choose a PNG or JPG file


Run and see the error.


Thank you.

MacBook Pro, OS X Mavericks (10.9)

Posted on Oct 23, 2014 3:24 AM

Reply
53 replies

Mar 24, 2015 8:36 AM in response to Tony T1

I have no idea what I'm doing wrong. Is this procedure alright:


1) Copy /System/Library/Automator/Watermark PDF Documents.action/Contents/Resources/tool.py

2) Delete original script, paste Hiroto's script (I did this with TextEdit); save file

3) make it executable: chmod u+x [reference]

4) Run in Terminal (output should be "Usage: watermark —input <file> —output <file> <watermark files>")

Mar 24, 2015 12:22 PM in response to artnaz

artnaz wrote:


I have no idea what I'm doing wrong. Is this procedure alright:


1) Copy /System/Library/Automator/Watermark PDF Documents.action/Contents/Resources/tool.py

2) Delete original script, paste Hiroto's script (I did this with TextEdit); save file

3) make it executable: chmod u+x [reference]

4) Run in Terminal (output should be "Usage: watermark —input <file> —output <file> <watermark files>")


If you run in Terminal without any arguments, you will get errors.

If you run with the argument: —help, you will see the "Usage:" output.

Feb 15, 2016 12:25 PM in response to Tony T1

Hey there!

Thanks to Tony T1 & Hiroto - great work guys!

I managed to get the watermark workflow working on my machine. I now want to streamline it but I am kinda stuck. Here is the workflow I've got at the moment:


User uploaded file

It does get the job done but I would love to change a few things.


1) I would like to just drop the pdf onto the workflow and enter the watermark I need. However if I ask for the pdf first the shell script will take the watermark png as input and not the pdf. Any ideas how to change that? I already tried to set the pdf as a variable and to get that variable before the shell script is called. That didn't work out.


2) I would like to add the text of the watermark to the end of the file name. But I cant rename the output file without asking for it again before the renaming step. No clue why it doesn't accept the watermarked pdf as an input.


Oh and one more thing: Is there anyway to create a batch mode? So lets say I've got a text file with a lot of different names (Jenny Smith; Mike Meyers; the list goes on...). Could I feed that list of names into the workflow to output a watermarked pdf for very person? That would be the best case scenario!


Should I give up on automator and just do it all in a single apple script?


Any help is much appreciated 🙂

Feb 15, 2016 4:16 PM in response to kia.ora

kia.ora wrote:


Hey there!

Thanks to Tony T1 & Hiroto - great work guys!

I managed to get the watermark workflow working on my machine. I now want to streamline it but I am kinda stuck. Here is the workflow I've got at the moment:


It does get the job done but I would love to change a few things.


1) I would like to just drop the pdf onto the workflow and enter the watermark I need. However if I ask for the pdf first the shell script will take the watermark png as input and not the pdf. Any ideas how to change that? I already tried to set the pdf as a variable and to get that variable before the shell script is called. That didn't work out.


2) I would like to add the text of the watermark to the end of the file name. But I cant rename the output file without asking for it again before the renaming step. No clue why it doesn't accept the watermarked pdf as an input.


Oh and one more thing: Is there anyway to create a batch mode? So lets say I've got a text file with a lot of different names (Jenny Smith; Mike Meyers; the list goes on...). Could I feed that list of names into the workflow to output a watermarked pdf for very person? That would be the best case scenario!


Should I give up on automator and just do it all in a single apple script?


Any help is much appreciated 🙂


As VikingOSX said, you can now use the Watermark PDF Documents Workflow that's in Automator with OS X El Capitain


For an an Automator Workflow that you can "drop" PDF's on, and in batch mode:


First, d/l and install Dispense Items Incrementally from: http://www.macosxautomation.com/automator/examples/actions.html


Then use this Automator Workflow (and save as an Application):



User uploaded file

User uploaded file

User uploaded file

User uploaded file


The Run Shell Script Action is:


name=${1##*/}

echo ${name%.*}


To Run, "drop" as many PDF's (or Folders of PDF's) as you want onto the Application Icon.

This Workflow adds (Draft) to the end of the filename, but you can change that to any text you want.

Feb 28, 2016 1:36 PM in response to Tony T1

Hi Tony and VikingOSX,


I am aware of the fix in El Capitan, however I currently in the middle of a big project and unable to update. Thank you so much for your input. I was able to put together an Automator workflow which works on Yosemite. Here is how I did it:


User uploaded fileUser uploaded file

The workflow asks for an input text, creates a png of that text, watermarks the pdf with said text and then adds the input text to the filename. That way its very easy to watermark pdf with names. (e.g. a screenplay with actors/actresses names)


I already tried to assemble a similar workflow on Mavericks or OS X El Capitain but I was unable to do so. Do you guys have any ideas?

Automator: Watermark PDF Documents not working

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.