G'day Scripters
This works, but is a bit slow
if StoreMailBox = "" or StoreMailBox ≠ selected mailboxes of message viewers then tell application "System Events" to tell process "Mail" tell table 1 of scroll area 1 of group 1 of splitter group 2 of splitter group 1 of window 1 set tempList to every row --where (first UI element of UI element 1 whose role is "AXDisclosureTriangle") = 0 repeat with ThisMessage in reverse of tempList try if value of ((first UI element of UI element 1 of ThisMessage) whose role is "AXDisclosureTriangle") = 0 then tell ((first UI element of UI element 1 of ThisMessage) whose role is "AXDisclosureTriangle") to click on error errmsg number errnum if errnum ≠ -1719 then display dialog errmsg & errnum end try
end repeat end tell end tell set StoreMailBox to selected mailboxes of message viewers end if
This would be faster, and compiles, but returns zero rows. Is it possible to do this, or am I barking up the wrong tree?
Regards
Santa
if StoreMailBox = "" or StoreMailBox ≠ selected mailboxes of message viewers then tell application "System Events" to tell process "Mail" tell table 1 of scroll area 1 of group 1 of splitter group 2 of splitter group 1 of window 1 set tempList to every row where (first UI element of UI element 1 whose role is "AXDisclosureTriangle") = 0 say (count of tempList) repeat with ThisMessage in reverse of tempList try #if value of ((first UI element of UI element 1 of ThisMessage) whose role is "AXDisclosureTriangle") = 0 then tell ((first UI element of UI element 1 of ThisMessage) whose role is "AXDisclosureTriangle") to click on error errmsg number errnum if errnum ≠ -1719 then display dialog errmsg & errnum end try
end repeat end tell end tell set StoreMailBox to selected mailboxes of message viewers end if |