Summary
OS X 10.10 Yosemite にしてから、Automator の Watermark PDF Workflow が動作しなくなった。
Watermark PDF WorkflowのPythonスクリプトを修正後、
Run Shell Script で実行させることで動作するようになった。

patch
% diff -c /System/Library/Automator/Watermark\ PDF\ Documents.action/Contents/Resources/tool.py tool.py > watermark_pdf_yosemite.patch
として作成
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*** /System/Library/Automator/Watermark PDF Documents.action/Contents/Resources/tool.py 2014-09-10 07:34:59.000000000 +0900 | |
--- tool.py 2014-11-18 15:38:01.000000000 +0900 | |
*************** | |
*** 26,32 **** | |
def createImage(imagePath): | |
image = None | |
! provider = CGDataProviderCreateWithFilename(imagePath) | |
if provider: | |
imageSrc = CGImageSourceCreateWithDataProvider(provider, None) | |
if imageSrc: | |
--- 26,33 ---- | |
def createImage(imagePath): | |
image = None | |
! url = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, imagePath, len(imagePath), False) | |
! provider = CGDataProviderCreateWithURL(url) | |
if provider: | |
imageSrc = CGImageSourceCreateWithDataProvider(provider, None) | |
if imageSrc: | |
*************** | |
*** 74,79 **** | |
--- 75,81 ---- | |
yOffset = 0 | |
angle = 0 | |
opacity = 1.0 | |
+ scale = 1.0 | |
# Parse the command line options | |
try: |
patch 適用
% cp /System/Library/Automator/Watermark\ PDF\ Documents.action/Contents/Resources/tool.py ./tool.py
% patch < watermark_pdf_yosemite.patch
Automator の Run Shell Script
Pass input を to stdin から as arguments に変更しておく。Get Specified Finder Items で指定するWatermarkのファイルのパスは $1 に入る。
Finder から受け取るファイルのパスは $2 に入る。
$HOME/path/to/tool.py \
--over \
--xOffset 480 \
--yOffset 660 \
--angle 0 \
--scale 0.12 \
--opacity 1.0 \
--input "$2" \
--output "${2%.*} (Watermark).${2##*.}" \
"$1"
Reference
Automator Watermark PDF Workflow | Apple Support Communitieshttps://discussions.apple.com/thread/6620337