I just realized that I have a script-based rule that is still working in Leopard and took a look to see what I was doing differently. Try this:
using terms from application "Mail"
on perform mail action with messages selectedMessages for rule theRule
tell application "Mail"
set selectedMsgs to selection
repeat with msg in selectedMsgs
set theSubject to subject of msg
set theSender to extract name from sender of msg
set theAddress to extract address from sender of msg
set theDate to date sent of msg
set nowDate to current date
set theBody to "Uw bericht" & return & return & "Onderwerp: " & theSubject & return & "Verstuurd: " & theDate & return & return & "is ontvangen op " & nowDate & ".
Met vriendelijke groet,
Van Hooren drukkerij en repro bv
" & return
set newMessage to make new outgoing message with properties {subject:"Ontvangstbevestiging: " & theSubject, content:theBody & return & return}
tell newMessage
set visible to true
make new to recipient at end of to recipients with properties {name:theSender, address:theAddress}
end tell
--send newMessage
end repeat
end tell
end perform mail action with messages
end using terms from
That got your script working for me. (I moved the tell block to encompass everything you're asking mail to do and added the 'for rule theRule' clause)
Phil
On Jan 7, 2008, at 4:06 PM, J. Huisman wrote:
Hello Phil,
Thanks for your response.
At least your manual version works alright, but unfortunately I would love to see it run as a rule. (I don't know how to run it via iCal, as you mentioned)
I'ts too busy to, manually, respond every mail I receive...
I've seen the thread on Apple discussions, those are the ones I referred to in my mail, I even started a thread myself:
I'd lthink I'll send a bug report, to both the Mail- and Applescript folks.
Thanks for your help'