Mail.app: Showing remote images automatically for specific senders

6

1

In a similar way to what gmail allows, I'd like to get specific senders' remote images to be auto-loaded.

One option that I came across is using a rule and an applescript: https://discussions.apple.com/thread/2405934

However, this doesn't seem to work (at least on the current 10.7.3 - that solution is a bit outdated)

Any ideas how to fix this applescript or, alternatively, another way to achieve the desired end result?

GJ.

Posted 2012-05-06T13:24:08.573

Reputation: 8 151

Answers

6

You have been bitten by the brittleness of GUI Scripting solutions – viz. their dependency on the UI element hierarchy of the target application. In the case of Mail.app, this hierarchy has changed rather drastically with Lion (no surprise there, as Lion’s Mail.app was a rather drastic update from earlier versions). The correct UI address of the “Load Images” button is now

button 1 of UI element 1 of row 1 of table 1 of scroll area 1 of window

As this is rather a mouthful to chew on, I’d recommend modifying the original script to operate on a reference, changing the core GUI Scripting command as follows:

set loadButton to a reference to button 1 of UI element 1 of row 1 of table 1 of scroll area 1 of front window
if loadButton exists then click loadButton

Note, however, that this does not actually reproduce Gmail’s behavior – it will just open all mails meeting the rule condition(s) in a viewer window with inline server images displaying each time the rule is run. It does not affect inline message display (in the message preview column), nor does it apply when you open the message in a new window yourself. Barring writing your own Mail.app plugin, there is nothing you can do about that, as the only event processing mechanism Mail.app offers you can hook into with AppleScript is executing rules.

kopischke

Posted 2012-05-06T13:24:08.573

Reputation: 2 056

Is this still the only solution 6 years later? Would you update it for 2018 version of the Mail app on macOS? – Radi – 2018-05-02T14:34:59.530

1I’m not sure what you mean by the 2018 version of Mail: does the solution not work on macOS 10.13 (I can’t check, as I have avoided updating to High Sierra for reasons unrelated to this question)? – kopischke – 2018-05-02T14:39:32.443

I was asking if that is still the only solution and if maybe there is a way to do that without the script. – Radi – 2018-05-02T16:17:39.853

1Not that I know of, but why not ask that (“how to achieve X without resorting to a Mail rule”; don't forget to mention you are aware of this answer, or your question risks being closed as a duplicate) as a new question? – kopischke – 2018-05-02T16:43:24.147