Re: Scripting Mail:get selection
Re: Scripting Mail:get selection
- Subject: Re: Scripting Mail:get selection
- From: Michelle Steiner <email@hidden>
- Date: Mon, 24 Feb 2003 16:43:12 -0700
On Monday, February 24, 2003, at 04:28 PM, cricket wrote:
I'm going to side with JD on this one. For what it's worth, I too
find Mail scripting obtuse.
Maybe I'd side with you too if you provided some examples. :)
1. If you're not using the preview pane, but open each message in its
own window, how do you access the message in the front window?
How do you identify the message that is in reply to a received message?
Here's an example from emailer that files an outgoing reply with
message it is in reply to:
set AnyMessagesMoved to false
tell application "Claris Emailer"
tell the front window
if its class is incoming message window then
set AnyMessagesMoved to my MoveAMessage(its displayed message,
AnyMessagesMoved)
if not AnyMessagesMoved then
my InfoDialog("The displayed message does not have existing
replies.")
end if
else if its class is browser window then
set the messagelist to the selection
if the messagelist is not {} then
repeat with testMessage in the messagelist
if class of the testMessage is incoming message then
set AnyMessagesMoved to my MoveAMessage(testMessage,
AnyMessagesMoved)
end if
end repeat
if not AnyMessagesMoved then
my InfoDialog("None of the selected messages have existing
replies.")
end if
else
my InfoDialog("There were no messages selected.")
end if
else
my InfoDialog("The front window has to be either an incoming message
window or a browser window.")
return
end if
end tell
end tell
on InfoDialog(instring)
display dialog instring buttons {"OK"} default button 1 with icon note
end InfoDialog
to MoveAMessage(testMessage, HasReply)
tell application "Claris Emailer"
set the ReplyMessageID to the reply id of the testMessage
try
move outgoing message id ReplyMessageID to the storage of the
testMessage
set HasReply to true
end try
end tell
return HasReply
end MoveAMessage
--
"There's some good in the world, Mr. Frodo, and it's worth fighting
for."
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.