Title: Re: Problem setting message properties via AppleScript
On 1/19/01 8:01 AM (-0800), Jim McCarty at [EMAIL PROTECTED] wrote:

> This is probably something simple that I've missed, so please enlighten me.
>
> I am trying to change the connection action of messages when I delete them by
> using the following code (I've compressed it by taking out all the variable
> usage into a single line):
>
> if connection action of (item 1 of the (current messages as list)) is leave on
> server then
>   set the connection action of (item 1 of the (current messages as list)) to
> remove at next connection
>
> I get this error when trying to do this: Can’t get leave on server of
> connection action of incoming message id 5158
>
> If I use just “connection action of (item 1 of the (current messages as
> list))” in Smile, I get leave on server, but as soon as I try using it in a
> boolean condition, I get rejected.
>
> The following code, however, works on the same message:
>
> if read status of (item 1 of the (current messages as list)) is untouched then
>   set the read status of (item 1 of the (current messages as list)) to read
>
> What am I doing wrong? Why can’t I test for connection action?

This is the script that I wrote and use. It works fine.

(*
This script will remove the selected message from the server at the next
connection; if the message still remains on the server.
Use in conjunction with the Junk Mail Filter to remove mail from
the server when checking mail from 2 locations.
*)

tell application "Microsoft Entourage"
    set theMessage to item 1 of (get current messages)
    if (connection action of theMessage) exists then
       set (connection action of theMessage) to (remove at next connection)
    end if
end
tell

--
 Andy Fragen
 <[EMAIL PROTECTED]>

Reply via email to