Re: Entourage Scripting Question
Re: Entourage Scripting Question
- Subject: Re: Entourage Scripting Question
- From: Barry Wainwright <email@hidden>
- Date: Sat, 28 Jan 2006 19:29:03 +0000
- Thread-topic: Entourage Scripting Question
On 27/1/06 21:55, "Stephen Lanza" <email@hidden> wrote:
> I am trying to write an applescript that will immediately move an incoming
> message into the deleted items folder if it matches a certain criteria.
>
> For example, a lot of spam has multiple occurrences of $,^,! and other
> characters that I want to immediately dump.
>
> I have written a script that can do this but only on selected messages or an
> entire folder. I really want the script to fire as each message is being
> brought over from the mail server so I am looking for an 'on' clause that
> Entourage will pass to my script the email message that is being import.
>
> Is this possible and if so can you point me to a resource that describes it?
>
> I have looked on a series of applescripting websites but have only found
> scripts that usually work on selected messages.
>
> Thanks for any help.
>
> Stephen Lanza
> Software Complement
'current messages' will return a list of messages that depends on the
context. It will be either:
A list of one message, if a message is open in the front window,
Or; a list of selected messages, if messages are selected...
Or; a list of one message being handled by a rule, if the script is running
as the action of a mail rule or MLM action.
It is this last item you want - set up a mail rule to run on all messages
that match your criteria, and to run your script as the action.
Furthermore, if you delete the same (list of) messages twice, they will be
deleted from the deleted items folder as well:
Tell app "microsoft entourage"
set theMessages to current messages
delete themessages
try
delete themessages
end try
End tell
--
Barry
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden