Mr_Noodle wrote:Unless you can demonstrate this script working fine outside of Hazel, but only failing within Hazel, there's not much I can do. You'll have to file a bug with Apple as this seems to be a problem with Mail's AppleScript on El Cap. You might want to also investigate alternatives. Maybe Mail's Automator actions don't have this problem. Or you can try some other mail delivery service instead of relying on Mail.app.
Hi, I can confirm that the script does not work even outside Hazel. For example, I tested th below (obviously anonymised email addresses). This looks like Apple script problem.
set theAttachment1 to "/Users/vladimirjirasek/Downloads/file.csv"
set subject_ to "Filed receipt"
set the_content to "This is a receipt filed into the receipt folder"
tell application "Mail"
set newMessage to make new outgoing message with properties {subject:subject_, content:the_content & return & return}
tell newMessage
set visible to false
set sender to "xxx@xxxx.com"
make new to recipient at end of to recipients with properties {address:"yyy@yyyy.eu"}
make new attachment with properties {file name:theAttachment1} at after the last paragraph
(* change save to send to send*)
send --<<<<---------------- change save to send to send or send to save to save to drafts
(* change save to send to send*)
end tell
end tell