applescript save mail attachment (10.10) Yosemite
I have a script that I run to save pdf attachments that come in via email. This script has served me well till this latest upgrade. Once I installed Yosemite (OS X 10.10) the script stopped working. I have dug around but cannot find a solution. Can someone please look at this and explain what is failing and how I can fix it?
Thank you for your time.
Mano
using terms from application "Mail"
on perform mail action with messages theMessages --for rule theRule
-- Only use hardcoded path! DO NOT USE choose folder. It will crash Mail if you do
-- Script modified for 10.8 on 09/12/13 MV
-- as of Mac OS X 10.8 Mail.app applescripts can only save to the downloads directory
-- the shell script below moves the file from downloads to its proper place for processing
set theOutputFolder to "MyComputer:Users:me:Downloads:" -- replace quoted text with your desired path
set theNextDelivery to "NextDelivery.pdf"
tell application "Mail"
repeat with theMessage in theMessages
if theMessage's mail attachments is not {} then
repeat with theAttachment in theMessage's mail attachments
set theFileName to theOutputFolder & theNextDelivery
--display dialog ("Filename ")
try
save theAttachment in theFileName
on error errnum
end try
end repeat
end if
end repeat
end tell
end perform mail action with messages
do shell script "/Users/me/Documents/Scripts/Fuel_Next_Delivery/NextDelivery.sh"
end using terms from
OS X Yosemite (10.10), 16GB RAM