• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: funny FM/AS/OE behavior - Help!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Prev by Date: Re: funny FM/AS/OE behavior - Help!
  • Next by Date: Re: Subject: checking form of input
  • Previous by thread: Re: funny FM/AS/OE behavior - Help!
  • Next by thread: Re: GraphicConverter & saving files in new places
  • Index(es):
    • Date
    • Thread