How to select a message in Mail
How to select a message in Mail
- Subject: How to select a message in Mail
- From: fishy <email@hidden>
- Date: Sat, 20 Jan 2007 20:42:44 +0800
Hi folks.
I'm writing a script to be used by Mail rules to automatically set
text encoding of some mails (that they didn't encoded well so Mail
can't get their encoding automatically).
I've found 2 examples that one can get messages returned by rules, and
one can "click" on the menus (so that can change encoding of a
selected mail), but don't know how to combine them together.
The first script is:
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
tell application "Mail"
repeat with eachMessage in theMessages
(* do something here *)
end repeat
end tell
end perform mail action with messages
end using terms from
this script can get the messages returned by the rule (to "eachMessage")
And the secont script is:
tell application "System Events"
if UI elements enabled then
click menu item "Chinese (GB 18030)" of menu "Text Encoding" of menu
item "Text Encoding" of menu "Message" of menu bar 1 of process "Mail"
end if
end tell
this script can change the text encoding of the selected mail to GB18030.
So what I need to do is, in the "do something here" in the Script 1,
select the mail, and insert Script 2.
So, anyone have some advice on how to select the message? I've tried
"select eachMessage" and "select message eachMessage" but seems
neither works.
Your help is appreciated
--
regards,
fishy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/mailman//archives/applescript-users
This email sent to email@hidden