I have a little AppleScript that pulls a message from a database, formats a message and puts it in the body of a new mail message.
I can’t get Eudora to set the “From” portion correctly though. In one case it looks right in the field, but isn’t correct when it gets sent (e.g. the field in the from portion has the right name, but it still shows “dominant” next to it and it sends from dominant). Any suggestions on setting the “From” properly?
I tried “personality” “from” and “sender” as below in the commented portion.
tell application “Eudora”
activate
make message at end of mailbox “out” of mail folder “”
set field “to” of message 0 to “”
–set personality of message 0 to “PERSONALITYNAME”
–set field “from” of message 0 to “”
–set sender of message 0 to “”
set field "subject" of message 0 to "My topic of the day, " & theDateString
set field "" of message 0 to theBody
--queue message 0
end tell
-“theBody” is defined elsewhere, by the way.
Oh yeah, this does this in 5.x and 6.0.x now. I thought it might be a version problem, but not for me.
tell application "Eudora"
activate
set nm_ to make message at end of mailbox 2 of mail folder ""
set field "to" of nm_ to "<ace@poker.com>"
set personality of nm_ to personality "PERSONALITYNAME" -- case counts
set field "subject" of nm_ to "My topic of the day, " & theDateString
set body of nm_ to theBody
queue nm_
end tell
Hmmm. What happens if you refer to the personality by index?
tell application "Eudora"
activate
set nm_ to make message at end of mailbox 2 of mail folder ""
set field "to" of nm_ to "<ace@poker.com>"
set personality of nm_ to personality 2
set field "subject" of nm_ to "My topic of the day, " & theDateString
set body of nm_ to theBody
queue nm_
end tell
I’m don’t know what the problem might be. Both scripts work for me with Eudora 6.0.1 (paid mode) and OS X 10.2.8. Does the following snippet return the correct number of personalities.
tell application "Eudora" to count personalities
display dialog result
On a lack (with 6.0.0 still) I just copied and pasted your code in and it worked (with only a few changes - definiting theBody etc). I am going to re-try with the first ones and then by modifying your code and see what happens.
E.g.:
tell application “Eudora”
activate
set theBody to “msg body”
set nm_ to make message at end of mailbox 2 of mail folder “”
set field “to” of nm_ to “ace@poker.com”
set personality of nm_ to personality 6
set field “subject” of nm_ to "My topic of the day, " & “theDateString”
set body of nm_ to theBody
–queue nm_
end tell
In regards to this particular script, there should be no difference between Eudora 6.0 and 6.0.1. I would be surprised if it didn’t work in v5.x as well.
I am not sure what the problem is, but I think there must be something with that script - because yours works fine, modifying yours works fine. It is really strange. I think it is working now, I am going to keep testing (and go to 6.0.1 too).
Thanks again for the help. It was very helpful to know that a particular syntax worked for someone because that helped to eliminate it being a problem with me coding wrong.