Title: Re: Junk email folder
On 5/18/04 12:08 AM, "Scott Haneda" <[EMAIL PROTECTED]> wrote:

> on 05/18/2004 12:06 AM, Paul Berkowitz at [EMAIL PROTECTED] wrote:
>
>>> This would get rid of one folder for me, and seems a little nicer, is this
>>> safe to use as a normal folder?
>>
>> Yes.
>
> Thanks Paul, I wonder if you could help me mod this script a little as well:
>
> I need a condition in it...
> If to: starts with postmaster@ then

   If "to:" starts with postmaster@ ??? Hello? Are you sure you don't mean "From:"? These are messages sent to you? Could they be TO a postmaster with you as CC? Sure you don't actually mean "FROM"?

>  just move the message to "!!!SPAM!!!"

I thought you wanted it to go to Junk E-mail folder. (We generally don't have modifiers like "just" in scripting languages, BTW. ;-)

> Else
>   do the normal forward.
> End if
>
> Original script below:
> tell application "Microsoft Entourage"
>     set msgList to current messages
>     repeat with oneMsg in msgList
>         move oneMsg to folder "!!!SPAM!!!"
>         set theFwd to forward oneMsg to
>        "[EMAIL PROTECTED]" without opening window
>         send theFwd with sending later
>     end repeat
> end tell


tell application "Microsoft Entourage"
    set msgList to current messages
    repeat with oneMsg in msgList
        if address of address of (first recipient of oneMsg) starts with "postmaster@" then
            move oneMsg to folder id 6 -- this is Junk E-mail folder, named whatever you like, or else: folder "Junk E--mail"
        end if
        set theFwd to forward oneMsg to "[EMAIL PROTECTED]" without opening window
        send theFwd with sending later
    end repeat
end tell

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

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

Reply via email to