I'm running tests today, and I keep getting failures with error messages like this:
------------------------------------------
Error: Can’t get «class mssg» 1 of «class mbxp» "Incoming POP Messages" of «class mact» "listmeister-suddenlink". Invalid index.
------------------------------------------
Error Number: -1719
------------------------------------------
using terms from application "Mail"
on perform mail action with messages theMessages for rule theRule
try
tell application "Mail"
repeat with eachMessage in theMessages
set theSubject to subject of eachMessage
tell application "BBEdit"
activate
tell text of front text window
set after it to theSubject & return & return
select insertion point after it
end tell
end tell
end repeat
end tell
on error eMsg number eNum
set {c, s} to {return, "------------------------------------------"}
set e to s & c & "Error: " & eMsg & c & s & c & "Error Number: " & eNum & c & s
beep
set dDlg to display dialog e buttons {"Cancel", "Copy", "OK"} default button "OK"
if button returned of dDlg = "Copy" then
set the clipboard to e
end if
end try
end perform mail action with messages
end using terms from