Re: Script Suddenly Failing

From: Paul Berkowitz (berkowit_at_spoof_silcom.com)
Date: 05/06/04


Date: Thu, 06 May 2004 08:26:45 -0700

On 5/6/04 6:04 AM, in article BCBFB027.C9FF%honeypot@die.spam.die, "Sam L
Elowitch" <honeypot@die.spam.die> wrote:

> I had thought that this script, which I trigger on a schedule, was working
> fine:
>
> tell application "Microsoft Entourage"
> set theFolder to folder "Personal" of folder "Inbox"
> set allGroupMembers to (content of every group entry of group
> "Subscribed Forums")
> move (every message in theFolder whose sender is in allGroupMembers and
> read status is read) to folder "Deleted Items"
> end tell
>
> Unfortunately, it seems to only deleted a selected message whose read status
> is read and which is a member of the group "Subscribed Forums". Odd.
>
> I've tried checking and double-checking the display names and e-mail
> addresses and I'm certain they're correct.
>
> What could be wrong with this script?

It works just fine here. You're saying that unless you happen to have that
"Personal" folder open with a particular message meeting the criteria
selected (highlighted) in the UI nothing happens when you run the script?

Selection is irrelevant here. There's no mention of selection or 'current
messages' in the script. 'move' - if it's working at all (i.e. the folder
must be local, not IMAP or Hotmail) should be working on the whole set of
messages meeting the criteria. And the 'whose' clause is structured
correctly (normally 'is in' requires list brackets around {sender} but not
in a whose clause). So - IF the display names are really EXACTLY the same in
both email message and contact name/group entry, then it should work. It
does here.

Personally, I think you should avoid all possibility of the sender using a
slightly different display name by instead using this version:

tell application "Microsoft Entourage"
    set theFolder to folder "Personal" of folder "Inbox"
    set allGroupMembers to (content of every group entry of group
"Subscribed Forums")
    delete (every message in theFolder where address of its sender is in
allGroupMembers and read status is read)
end tell

This way you just check addresses, not display names, and 'delete' is
better-behaved than 'move'.

However, I notice that the name of your group is "Subscribed Forums". If
this includes (or means) mailing lists, you should be aware that messages
from mailing lists are actually TO the mailing list, not FROM it. The
mailing list is not the message's sender - the original sender is. So if you
want to delete mailing list messages you'd have to fit in another criterion.
In fact you'd couldn't do it by simple whose clause, you'd have to do it by
repeat loop, checking each item of (address of every recipient) against the
same list of allGroupMembers or list of (list address of every mailing
list) if they're registered mailing lists in the MLM, which might be
quicker.

-- 
Paul Berkowitz
MVP Entourage
Entourage FAQ Page: <http://www.entourage.mvps.org/toc.html>
AppleScripts for Entourage: <http://macscripter.net/scriptbuilders/>
Please "Reply To Newsgroup" to reply to this message. Emails will be
ignored.
PLEASE always state which version of Entourage you are using - 2001 or X.
It's often impossible to answer your questions otherwise.


Relevant Pages

  • Re: Script Suddenly Failing
    ... >> I had thought that this script, which I trigger on a schedule, was working ... >> set allGroupMembers to (content of every group entry of group ... I think you should avoid all possibility of the sender using a ... > from mailing lists are actually TO the mailing list, ...
    (microsoft.public.mac.office.entourage)
  • Re: Responses to the list (oops)
    ... The originator fields of a message consist of the from field, ... sender field, ... Resent fields SHOULD be added to any message that is reintroduced by ... suggestions that mailing lists can touch reply-to. ...
    (Debian-User)
  • Re: Script Suddenly Failing
    ... set allGroupMembers to (address of content of every group entry of group ... Entourage FAQ Page: AppleScripts for Entourage: Please "Reply To Newsgroup" to reply to this message. ... If>> this includes mailing lists, you should be aware that messages>> from mailing lists are actually TO the mailing list, not FROM it. ...
    (microsoft.public.mac.office.entourage)
  • Re: Sendmail and smrsh
    ... >> create mailing lists). ... > In these days with all those virus, worms and faked sender mails flying ... and already have a separate system ... yahda blah yahda blah). ...
    (Fedora)
  • {please}Re: basic list mail content: {[FC1] or [FC2] or [FC?]}
    ... was debated in the "Taming the mailing lists?" ... filter their fedora list messages into a separate folder by prepending ... -> N ## mmm dd Sender IdentificationOriginal long description of prob ... On the other hand I'd have no objection to being appended to the ...
    (Fedora)

Quantcast