apple mail again: awkward! can't open a message
apple mail again: awkward! can't open a message
- Subject: apple mail again: awkward! can't open a message
- From: Reinforced Darkness <email@hidden>
- Date: Sat, 13 Sep 2003 19:35:12 +0200
I wrote a script to do as an Entourage's feature: get in the sent
messages an history of messages replying or forwarding to a selected
message
so after difficulties to get the "Sent messages" (many thanks to
Delecour), I have the list of these messages. I want to open them into
a "message viewer", here's the whole script:
the last command "open each_message" won't work (Error: message won't
understand open)
I tried "make a new message viewer at front with data each_message":
nothing happens
how do U open a message (with GUI scripting)
//
tell application "Mail"
set la_selection to my selection_msg_Mail()
if la_selection b {} then
set la_selection to item 1 of la_selection
set boites_denvoi to {}
repeat with chaque in every pop account
set boites_denvoi to boites_denvoi & (every mailbox of chaque whose
name is "Sent Messages")
end repeat
repeat with _account in every imap account
set end of boites_denvoi to item 1 of (mailboxes whose name begins
with "Sent" and name contains name of _account)
end repeat
set messages_envoyes to {}
repeat with chaque_boite in boites_denvoi
set messages_envoyes to messages_envoyes & every message of
chaque_boite
end repeat
set sujet to (item 1 of my param_msg_Mail(la_selection)) as string
set les_bons to {}
repeat with chaque_msg in messages_envoyes
set objet to (item 1 of my param_msg_Mail(chaque_msg)) as string
if objet = "Re: " & sujet or objet = "Fwd: " & sujet then
set end of les_bons to chaque_msg
end if
end repeat
set nb to count of les_bons
repeat with chaque in les_bons
open chaque
end repeat
end if
end tell
-------------------
on selection_msg_Mail()
tell application "Mail"
activate
set la_selection to selected messages of item 1 of every message
viewer
try
return la_selection
on error
display dialog "aucun message n'est sC)lectionnC)!" with icon note
giving up after 3
return {}
end try
end tell
end selection_msg_Mail
-------------------
on param_msg_Mail(le_message)
tell application "Mail"
tell le_message
set sujet to the subject
set corps to the content
set expediteur to the sender
set ladate to the date sent
set destinataire to the recipients
end tell
return {sujet, corps, expediteur, ladate, destinataire}
end tell
end param_msg_Mail
//
_______________________________________________
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.