Re: Set "to" not "sender" in Outlook express
Re: Set "to" not "sender" in Outlook express
- Subject: Re: Set "to" not "sender" in Outlook express
- From: Paul Berkowitz <email@hidden>
- Date: Mon, 25 Feb 2002 19:14:28 -0800
On 2/25/02 3:19 PM, "Pamela Takeshige" <email@hidden> wrote:
>
I am using a script I got from a book and I am trying to modify it. It now
>
copies the sent items box of Outlook Express into a FileMaker Pro database
>
that I have. It does it well. But I want to change the settings so that it
>
copies the email address of the person I sent it to, not my address, which
>
it does now. I don't need to keep a record of my address, I would rather
>
keep the email address of the person I sent it to.
>
>
I have looked at the dictionary of the Outlook Express to find the command
>
for doing that. I tried "recipient", but I keep getting an error saying that
>
I can not use it. There is a command "sender" but there does not seem to be
>
a command for "To"....?? Can anyone give me a hint where to go with this.
>
the wole script is at the bottom, but the bit that needs changing is:
>
>
__________________________
>
on processMail(myMessage)
>
tell application "Outlook Express"
>
move myMessage to folder "Read Mail"
>
_____ set mySender to sender of myMessage_________
>
set mySenderAddress to address of mySender
>
set mySenderName to display name of mySender
>
set mySubject to subject of myMessage
>
set myContent to content of myMessage
>
set myTimeSent to time sent of myMessage
>
end tell
>
____________________________________________
>
You do realize that you might be sending a message to 100 recipients, or 43,
or 2, not just 1? And that some of them might bee cc or bcc recipients?
'recipient' is an element, not a property, of a message. the simplistic way
would be to look for 'recipient 1' of myMessage, but i think you'd be
better off to go for
first recipient of myMessage whose recipient type is (to recipient)
Then you'll notice from the OE Dictionary that 'recipient' has a rather
confusing syntax (adopted from Apple's mail Suite - it's not OE's fault!)
Class recipient: Message recipient
Plural form:
recipients
Properties:
address address -- the recipient's address
recipient type to recipient/cc recipient/bcc recipient/newsgroup
recipient -- the type of recipient
And this particular 'address' is not the string email address you mighty
expect, but the 'address' class type:
Class address: An e-mail message address
Plural form:
addresses
Sub classes:
contact
Properties:
display name Unicode text -- the name used for display
address string -- the e-mail address
(This is the same syntax that 'sender' has, since 'sender's type is in fact
this 'address' type).
So what you're looking for to substitute for
>
_____ set mySender to sender of myMessage_________
in the original script is, I think:
set firstRecipient to first recipient of myMessage whose recipient type
is (to recipient)
set myRecipient to address of firstRecipient
Then you can continue:
set myRecipientAddress to address of myRecipient
set myRecipientName to display name of myRecipient
--
Paul Berkowitz
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.