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: Pamela Takeshige <email@hidden>
- Date: Wed, 27 Feb 2002 08:20:25 +0900
Thank you Paul. I was able to get it to work. See below.
Next I am going to try to figure out a way to save the attachments that I
sometimes get into a special folder....
But, I did run into a tiny snag....
>
So what you're looking for to substitute for
>
> _____ set mySender to sender of myMessage_________
>
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
I could not get the whole first line to work. The script kept stopping at
the '(' just before (to reipient). But if I cut part of it, it does work, at
least to get the first recipient, as Paul Berkowitz said. I have included
the whole script below in case anyone is interested in trying it.
whole script
_______________________________________
global myKeywordMatches
on run
set myKeywords to {""}
set mySearchType to "or"
set myIncludeSubject to true
set myIncludeBody to true
tell application "Outlook Express"
set myMessages to every message in sent mail folder
repeat with myMessage in myMessages
set myText to ""
set myKeywordMatches to ""
if myIncludeBody then set myText to myText & the content of
myMessage & return
if myIncludeSubject then set myText to myText & the subject of
myMessage
set myFound to false
considering case
repeat with myKeyword in myKeywords
if myText contains myKeyword then
set myFound to true
set myKeywordMatches to myKeywordMatches & myKeyword
& " "
if mySearchType = "or" then exit repeat
else
if mySearchType = "and" and myKeyword ュ last item of
myKeywords then
set myFound to false
exit repeat
end if
end if
end repeat
end considering
if myFound then
my processMail(myMessage)
end if
end repeat
end tell
end run
on processMail(myMessage)
tell application "Outlook Express"
move myMessage to folder "Read Mail"
set firstRecipient to first recipient of myMessage
set myRecipient to address of firstRecipient
set myRecipientAddress to address of myRecipient
set myRecipientName to display name of myRecipient
set mySubject to subject of myMessage
set myContent to content of myMessage
set myTimeSent to time sent of myMessage
end tell
tell application "ファイルメーカー Pro"
tell database "Outgoing Mail"
set myNewRecord to (create new record)
set cell "recipient name" of myNewRecord to myRecipientName
set cell "recipient address" of myNewRecord to
myRecipientAddress
set cell "subject" of myNewRecord to mySubject
set cell "content" of myNewRecord to myContent
set cell "time sent" of myNewRecord to myTimeSent as text
end tell
end tell
end processMail
_______________________________________________
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.