5

I would like Mail on Yosemite to load remote content from senders in my contacts and not for everyone else. I have remote content disabled now and I have pieced together an AppleScript to click the button but it doesn't seem to be working. Here's what I have:

using terms from application "Mail"
on perform mail action with messages theMessages for rule loadRemoteContent
    tell application "Mail"
        activate
        repeat with eachMessage in theMessages
            open eachMessage
            tell application "System Events" to tell process "Mail"
                if not (window 1 exists) then return beep 1
                try -- message displayed in a mailbox window
                    click button "Load Remote Content" of UI element 1 of row 1 of table 1 of scroll area 1 of splitter group 2 of splitter group 1 of window 1
                end try
                try -- message displayed in a separate mail window
                    click button "Load Remote Content" of UI element 1 of row 1 of table 1 of scroll area 1 of window 1
                end try
            end tell
        end repeat
    end tell
end perform mail action with messages
end using terms from

This script is hooked into a rule in mail were that script is supposed to run when "sender is in contacts"

EDIT: So this is working when I get new mail after allowing Mail to "control my computer using accessibility features" in system preferences. However, I still would like it to work when viewing any message, either one that just came in or one I've had for years.

You must log in to answer this question.

Browse other questions tagged .