A few weeks ago, based on some useful information on this list, i rewrote one of my scripts to use Mail's "attachment" to get mail attachments (as opposed to my old script, which saved the message, and then ran it through Stuffit to extract the attachment).
Today, I tried to run this script, and it failed miserably. After observing that this fragment wasn't saving the attachment into the minutesFolder:
repeat with anAttachment in (get every attachment of content of theMessage) try if name of anAttachment contains "Minutes" and name of anAttachment ends with ".doc" then set fileName to tempFolderName & (name of anAttachment) save anAttachment in fileName tell application "Finder" to set end of minutesFiles to (file fileName) end if end try end repeat
I wrote up this minimal reproducer:
on run tell application "Mail" set theSelection to the selection set theMessage to item 1 of theSelection set a to (get every attachment of content of theMessage) end tell end run
Lo and behold, when I run it in Script Editor, my result pane showsÂ
{application "Mail"}
Has something changed in Mail scripting in 10.4.3 or some other recent update?
Thnaks,
Neil Faiman
|