Re: Mail email to Filemaker
Re: Mail email to Filemaker
- Subject: Re: Mail email to Filemaker
- From: Nigel Smith <email@hidden>
- Date: Wed, 12 Nov 2003 15:35:20 +0000
On 12/11/03 10:54, "Rod McDevitt" <email@hidden> wrote:
>
Thanks for your help but
>
>
" tell application "Mail"
>
activate
>
set var70 to name of to recipient
>
set var71 to sender of message
<snip>
You aren't telling Mail which message you want to take the data from.
Here's a script, tested under Panther, which takes the info you were after
from one or more *selected* emails and puts it into one or more new records
in a FMPro database called "testDB". Should be enough to get you started.
Watch the line-breaks:
---begin script
tell application "Mail"
set messageList to the selection
if (count of messageList) = 0 then
display dialog "You must select one or more messages first"
return 0
else if (count of messageList) = 1 then
set messageList to messageList as list
end if
set dataList to {}
repeat with eachMessage in messageList
set end of dataList to {recipName:name of recipient 1 <line-break>
of eachMessage, recipAdd:address of recipient 1 of <line-break>
eachMessage, sendAdd:sender of eachMessage, <line-break>
subj:subject of eachMessage}
end repeat
end tell
tell application "FileMaker Pro"
repeat with eachItem in dataList
create new record with data {recipName of eachItem, <line-break>
recipAdd of eachItem, subj of eachItem} at database "testDB"
end repeat
end tell
---end script
HTH,
Nigel
_______________________________________________
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.