What I think I need is an applescript that takes the first non blank line of
text in an email and puts it into the from header. That way my other rules
can process the email properly and I'll be able to reply to the original
sender.
The applescript dictionary for Entourage allows me to set the sent by property field but I’m guessing that won’t reset the from header.
You don't need to reset the From header. You're not scripting Lotus, after all. If you knew the email address of the real sender, you could reset the sender to the real sender. But what good would it do just to reset his display name, and not his email address? You can't reply by clicking reply: it will just go back to your work computer.
As I told you the last time (and I DID reply) you need proper Forwarding headers. Then it could be parsed, the real sender's name and address could be put into the email, and you could even reply to it.
This text stuff is very complicated, you know, and takes quite a lot of time and trouble to get "the first line": you're forgetting the little > marks at the beginnings of reply lines, etc. I can put in the sender's display name that way for you, but I'm not sure I see the point if your Lotus forwarding refuses to give you the original sender's email address as well. Surely it must? Somewhere? The only benefit you get from this is that it will show up as from the real sender's name in your Message pane. But you still can't reply to him without his email address.
tell application "Microsoft Entourage"
set theMsg to item 1 of (get current messages)
if address of sender of theMsg is "[EMAIL PROTECTED]" then
set theContent to content of theMsg
repeat with i from 1 to (count paragraphs of theMsg)
if paragraph i of theMsg � "" then
set nameLine to paragraph i of theMsg
repeat while nameLine starts with ">"
set nameLine to text 2 thru -1 of nameLine
end repeat
try
repeat while character 1 of nameLine = " "
set nameLine to text 2 thru -1 of nameLine
end repeat
set display name of sender of theMsg to nameLine
exit repeat
end try
end if
end repeat
end if
end tell
--
Paul Berkowitz
