Hi, I have a script to autoreply in Mail which works great. However, I can’t figure out how to add to the script to include an attachment in the reply email…can any one help?
This is the current script I have:
Code:
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with eachMessage in theMessages
set theName to extract name from sender of eachMessage
if exists reply to of eachMessage then
set theAddress to reply to of eachMessage
else
set theAddress to extract address from sender of eachMessage
end if
set newMessage to make new outgoing message
tell newMessage
make new to recipient at end of to recipients with properties {name:theName, address:theAddress}
set visible to false
set subject to "Re: " & subject of eachMessage
set content to "Thanks for applying for this weeks competition, please find the quiz sheet attached."
end tell
send newMessage
tell eachMessage
set was replied to to true
end tell
end repeat
end tell
end perform mail action with messages
end using terms from