Title: Re: Suggestions of workaround for apple script that adds to group
On 1/9/05 9:33 PM, "Scott Haneda" <[EMAIL PROTECTED]> wrote:

I use this AppleScript to add a single email address to a group.

tell application "Microsoft Entourage"
    set theMessage to item 1 of (get current messages)
    set theAddress to content of theMessage

Content??? Why should the content be an email address? Do you mean 'sender', or 'address of sender'?

   make new group entry at end of group "photoxicated.com" with properties {content:theAddress}

Well, I don't know about that. The content of a group entry, when being set rather than got, has to be of the form "Display Name <[EMAIL PROTECTED]>" although you can omit the Display Name. I guess that's what you're doing.

end tell

I have a web script I wrote that sets the body of a email to an email address and then sends that email to me, with a code in the subject.  When Entourage sees that code, it runs the above script.

Entourage seems to add a \r\r to the body of a email for some reason, so I end up with [EMAIL PROTECTED] in my group.  Cosmetically, this looks fine in the group, but when it hits the email server and a DNS lookup is attempted to be made on example.com\r\r, of course, the domain can not be found.

I have full control over the content of the notification email that is sent, so I can make the body of the email something like [EMAIL PROTECTED], but then I need help having the above AppleScript get the string between ## and ##

Maybe it's time for you to read the AppleScript language Guide, or one of the many books now out on AppleScript? Hanaan Rosenthal's AppleScript book (its title is about 19 words so I tend to forget it) is probably best for you at this stage. It's at Amazon.com .

Any help is appreciated.

set someCrap to content of theMessage
set AppleScript test item delimiters to {"##"}
set justTheAddress to text item 1 of someCrap
set AppleScript test item delimiters to {""}

make new group entry at group "pixelated.com" with properties {content:justTheAddress}


--
Paul Berkowitz
MVP MacOffice
Entourage FAQ Page: <http://www.entourage.mvps.org/faq/index.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>

PLEASE always state which version of Microsoft Office you are using - **2004**, X  or 2001. It's often impossible to answer your questions otherwise.

Reply via email to