OSXの標準印刷ダイアログには「"メール"で送信」という機能があり,これを使うと,PDFが添付されたメールが作成されます。
しかし,筆者はOutlook for Macを常用しており,標準の「"メール"で送信」は使えません。
そこで,Automatorを使って,Outlook版「"メール"で送信」を行う「プリントプラグイン」を作りました。
といいつつ,筆者にとって「"メール"で送信」が必要なのは,主にPDFの一部ページをeFaxで送信する場合です。
たとえば,複数ページのPDFに対し,先頭ページに受領印(スタンプ)を押して先頭ページのみ返信するといった使い方です。 eFaxは,メールにPDFを添付してFAXを送受信するインターネットFAXサービスで,FAXを送信する場合は「81«FAX番号»@efaxsend.com」というアドレス(ただし«FAX番号»は冒頭の0を除外)にメールを送信することになります。内容
「AppleScriptを実行」アクションのみでできています。
アクション「AppleScriptを実行」
on run {input, parameters}
set InputPDFs to input
set FAXnumber to text returned of (display dialog "FAX番号(ハイフンなし)" default answer "")
tell application "Microsoft Outlook"
set newMessage to make new outgoing message
if length of FAXnumber > 9 then
set efaxAddress to {email address:{name:"FAX" & FAXnumber, address:"81" & (text 2 thru -1 of FAXnumber) & "@efaxsend.com"}}
make new to recipient at newMessage with properties {efaxAddress}
end if
tell newMessage
repeat with aPDF in InputPDFs
make new attachment with properties {file:aPDF}
end repeat
end tell
open newMessage
get newMessage
end tell
return input
end run