Mail's background

Hello

I’m trying to automate some cleaning in my mailboxes.

I wanted to put a flag on every messages whose background color is green.
I was unable to make a script doing the job.
So I wrote this short one to check the used syntax.

It runs perfectly except that it returns mising value for a message whose background is set to green.
Do you know a workaround ?

-- [SCRIPT]

tell application "Mail"
 activate
 set theMailBox to mailbox of ((selection as list)'s item 1)
 tell theMailBox
 set i to 2
 set background color of message i to green
 set properties_i to (properties of message i)
 set bkgcolor to background color of properties_i
end tell -- to mailbox
end tell -- to Mail

-- [/SCRIPT]

(* the report display:

. message size:3452, junk mail status:false, date received:date “samedi 13 janvier 2007 16:38:47”, read status:true, was replied to:false,
background color:missing value,
date sent:date “samedi 13 janvier 2007 16:20:12”, floating:false, .

*)

Yvan KOENIG (from FRANCE dimanche 21 janvier 2007 20:35:36)

Bonsoir Yvan,

I regard this behavior as a bug.
In Script Debugger the value of property background color is always displayed as NSInternalScriptError (8)
Only setting is possible.
I’m sorry about having no idea to work around

Thanks

When I met such an oddity, I always assume that I made something wrong so, I ask for others users advices.

I will post a bug report.

Edit: it’s sent.

Yvan KOENIG