Re: collect set of responses messages
Re: collect set of responses messages
- Subject: Re: collect set of responses messages
- From: René v Amerongen <email@hidden>
- Date: Fri, 25 Jul 2008 23:55:19 +0200
All,
Thanks for the answers.
Tonight I did have some time to put my readings into practice.
I came up with the following.
on run {input, parameters}
tell application "Mail"
activate
set msg to item 1 of (selection as list)
set msgAccount to name of account of mailbox of msg
set msgMailboxname to name of mailbox of msg
set viewer to make new message viewer
--delay 1
tell application "System Events" to tell application process "Mail"
keystroke "m" using {command down, shift down}
end tell
activate
-- test point
-> return selection & {msg} & {msgAccount} & {msgMailboxname}
set selected mailboxes of viewer to {mailbox msgMailboxname of
account msgAccount}
delay 0.2
set selected messages of viewer to {msg}
delay 0.3
tell application "System Events" to tell application process "Mail"
keystroke "k" using {command down, shift down}
end tell
set visible messages of viewer to selected messages of viewer
return selection & {msg} & {msgAccount} & {msgMailboxname}
end tell
end run
This does what I want, but eh BUT;
The following problems are arising here,
if I choose a smart folder, select a message, do my thing ( running
the script ), it works.
if I choose an account in my inbox folder, select a message, do my
thing ( running the script ), it works.
if I choose the inbox ( top inbox folder), select a message, do my
thing ( running the script ), it fails with the following error;
Mail got an error: Can’t set selected messages of message viewer id
256924272 to selected messages of message viewer id 256924272. (6495536)
if I choose a mailbox folder , select a message, do my thing ( running
the script ), it fails also with the error;
Mail got an error: Can’t get account of mailbox of message id 446115
of mailbox "Development/Apple/Apple Lists - Applescript Users".
(372668800)
the difference between the two of them is that in the inbox case, the
error pops up at the line :" set visible messages of viewer to
selected messages of viewer". With the mailbox folder right from the
start at set msgAccount to name of account of mailbox of msg
.
How is this possible, in the first three trials because the selected
message is the same.
The return value reads ( also at the test point in code in all the
cases),
{message id 446613 of mailbox "INBOX" of account "rvamerongen" of
application "Mail", "rvamerongen", "INBOX"}
Can anyone help me out with this?
BTW, How can I change the title of a newly created message viewer
window?
Rene van Amerongen
Op 23 jul 2008, om 12:14 heeft René v Amerongen het volgende geschreven:
Dear List
Lets say, I did do a search, in mail and got a nice list of messages.
I see an item that I would like to investigate, but there is only
one or two messages from the whole conversation (responses) in this
search result list.
I would love to create a script that when I do select a message,
finds the other messages belonging to the same response set.
I am a n00b with applescript.
My Guess is that I have to read, all the messages and search them
for the right message-id, collect them, put them in a temp mailbox
and opens this in a new window.
My second guess is, because I have my mails in mailboxes, that I
check the message Id in that particular mailbox.
How do I get the right message-id?
Am I on the right track?
Or do you have better idea's, or even better, is there something
like this already around?
Thanks in Advance
Rene van Amerongen
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (applescript-
email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden
_______________________________________________
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/archives/applescript-users
This email sent to email@hidden