Re: funny FM/AS/OE behavior - Help!
Re: funny FM/AS/OE behavior - Help!
- Subject: Re: funny FM/AS/OE behavior - Help!
- From: Paul Berkowitz <email@hidden>
- Date: Tue, 10 Dec 2002 18:09:02 -0800
On 12/10/02 5:56 PM, I wrote:
>
tell application "Microsoft Entourage"
>
>
repeat with i from 1 to (count toRecips)
>
set toRecip to item i of toRecips
>
set AppleScript's text item delimiters to {" <"}
>
try
>
set eAddress to text item 2 of toRecip
>
set AppleScript's text item delimiters to {">"}
>
set dname to text item 1 of toRecip
>
set eAddress to text item 1 of eAddress
No, that's wrong. Sorry.
set theRecipients to {}
tell application "Microsoft Entourage"
repeat with i from 1 to (count toRecips)
set toRecip to item i of toRecips
set AppleScript's text item delimiters to {"<"}
try
set eAddress to text item 2 of toRecip
set dName to text item 1 of toRecip
if dName ends with " " then
try
set dName to text 1 thru -2 of dName
on error -- just a space
set dName to ""
end try
end if
set AppleScript's text item delimiters to {">"}
set eAddress to text item 1 of eAddress
on error -- no < > means no text item 2
set eAddress to toRecip
set dName to ""
end try
set AppleScript's text item delimiters to {""}
if eAddress contains "@" then -- otherwise skip this one
set end of theRecipients to {address:{address:eAddress, display
name:dName}, recipient type:(to recipient)}
end if
end repeat
-- do the same thing for ccRecips and bccRecips, appending each
recipient to toRecipients list with the appropriate recipient type
set newMsg to make new outgoing message at out box folder with
properties {subject:"foo", content:"bar", recipient:theRecipients}
send newMsg
end tell
end tell
--
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.