I’m a bit overdue for updating my Load Images AppleScript for loading images in Apple Mail messages for the latest version of Apple’s operating system for Mac OS X, 10.10 or “Yosemite”. I actually had a version ready during the betas of Yosemite, but somewhere along the way the button text changed from “Load Images” to “Load Remote Content”. So I had to repeat the investigative work to extract all of the translated versions of the button text. In other words, <whine>localization is hard.</whine> Also, I was lazy / busy.

At any rate, you can find the latest version on the Load Images in Apple Mail project page.

{ Comments on this entry are closed }

A reader question made me aware that my Load Images AppleScript for loading images in Apple Mail messages is specific to, and hard-coded for, the English language versions of Mac OS X. This is because the script is looking for a button with the text “Load Images”. Switch to any other language, and that button won’t—can’t—be found by the script. This is a limitation of using GUI Scripting to activate the button.

I’m not an expert in internationalization, and I don’t know if there’s a way to detect the active language of Mac OS X or, even better, look up the string to search for, regardless of language. If anyone knows how to do that kind of thing in AppleScript, please let me know. I’d love to add it to the script.

In the meantime, I’ve revised the script to make the text of the Load Images button easy to change. It’s one line at the start of the script, after the initial comments:

-- The text of the [Load Images] button in your version of Apple Mail.
-- If you're using a non-English version of Mac OS X, uncomment ONLY the line with your language on it, and save.
set loadImagesButtonNameTextString to "Load Images" -- English
-- set loadImagesButtonNameTextString to "Carica immagini" -- Italiano
-- set loadImagesButtonNameTextString to "Cargar imágenes" -- Español

If you want to use the script with a non-English version of Mac OS X, simply uncomment the line that has the right button name for your language, and save the revised script.

These are just the languages for which I could type the button name on my keyboard. For other languages, I had no idea how to type them on my US English keyboard! If you can contribute additional strings for the Load Images button in other languages, I would be grateful to add them, and will credit you for the addition. Just send them to me using the email in the sidebar.

The project page has the download link, and the script contains the version history, and a lot of details in the comments.

{ Comments on this entry are closed }

Load Images AppleScript Updated for Mavericks

by Michael Alderete on 11/25/2013

I’ve updated the Load Images AppleScript that lets you load images in a message via a keystroke, to be compatible with Mac OS X 10.9 “Mavericks”. The original post has the download link, and the script contains the version history, and a lot of details in the comments.

There are some important changes to the script’s behavior in Mavericks. If you’re using the script with Mac OS X 10.9, you need to give the script permission to control your Mac, and the process isn’t as intuitive or as clear as it could be. Read the rest of this entry (519 words) »

{ Comments on this entry are closed }

I like Apple Mail for Mac OS X, but one thing that irritates me to no end is that the Load Images button (Load Remote Content in Mac OS X 10.10), which loads the images in a message on-demand, doesn’t have a keyboard shortcut. Because it’s not a menu item, there’s no easy way to add one. I looked for a way to add a keystroke to Load Images for more than five years before I finally found a way to do it.

The hard part is triggering the Load Images button itself, by anything besides a mouse click. What finally did it was using the GUI Scripting feature of AppleScript to tell the button to click itself. Once I had an AppleScript that worked, it was simple to use FastScripts to trigger the script with a keyboard shortcut.

Why don’t I let Mail load images automatically? Spammers use image loading to confirm the validity of an email address. See this Apple Support Forum post for some details, and how to turn it off.

AppleScript to Load Images in Apple Mail

Download the Load Images script v1.6, 2014-12-31

The work of the script can be done by a single line that might look like this:

click button "Load Images" of 
    UI element 1 of row 1 of table 1 of scroll area 1 of front window

(Because’s user interface has changed across various versions, and with different preference settings, the actual code is more complex. See the AppleScript for the full, ugly details.)

This user interface elements path, or specifier, tells the GUI Scripting system how to reach a specific user interface element, in this case a button, and what to do with it. It’s far from obvious how to determine one of these UI specifiers just by looking at a Mail window; I used the very interesting developer tool UI Browser to figure it out.

It’s also specific enough to be brittle; it has changed from prior versions of Apple Mail, and will probably change in the future. When it does this script will stop working and start beeping. I’ve written the script to adapt to a few different version and configuration possibilities, and I’ll try to update it if it ever breaks. The current version (v1.6) is compatible with Mac OS X 10.5 (“Tiger”) through Mac OS X 10.10 (“Yosemite”).

The rest of the script is error handling and AppleScript ceremony. It should make sense if you’re familiar with AppleScript, and there are plenty of comments, so I won’t describe it here.

Add a Keyboard Shortcut for Running the AppleScript

Adding a keyboard shortcut for an already-existing menu item is easily done using the Keyboard preference pane. Adding a keyboard shortcut for an AppleScript requires a third-party utility. You might already have a favorite—there are lots to choose from—and so do I. FastScripts from Red Sweater Software does a great job handling application-specific AppleScripts, and it’s free if you don’t need more than 10 keyboard shortcuts. (It’s also a good value at $14.95 for the unlimited version.)

Create the shortcut for the AppleScript

  1. Install and run FastScripts, and then switch to
  2. From the FastScripts menu, choose Open Mail Scripts folder. Open Mail Scripts folder menu item
  3. Move or copy the Load Images script into the Mail Scripts folder.
  4. From the FastScripts menu, choose Preferences…, click the Script Shortcuts tab, and add your preferred keyboard shortcut. Keyboard shortcut for Load Images AppleScript

Note: If you use the same keyboard shortcut I did, Command-Shift-L, you’ll need to change the keyboard shortcut for the existing menu command that uses it, by adding a new one to that command, using the technique at the Mactuts+ article linked above.

{ Comments on this entry are closed }

Personal survey of anti-spam tools

by Michael Alderete on 1/7/2005 · 12 comments

In the three or four years I’ve been fighting unwanted e-mail messages with better tools than the Delete key I’ve tried almost a dozen different tools. This is a quick (ha!) survey of the ones I’ve used, and why I don’t (or do) still use them.

My very first anti-spam tool was something called Mailfilter. I used it for my personal e-mail on Mac OS X, wrote about it here, and almost immediately afterwards lost a non-spam message to an aggressive keyword match. That was the end of Mailfilter. I can’t even remotely recommend it, as it’s just not intelligent enough (strict, single expression matching), and had zero safety net.

My next attempt at a solution was a utility called SpamFire. Like Mailfilter, it is a “pre-filter,” which means it would run before my e-mail client, download my mail, and skim out the spam. Unlike Mailfilter, it actually saved the trapped messages, so if it made a mistake, I could recover the message. It had plenty of other differences from Mailfilter, which I wrote about previously, and which made it so useful that it became the first anti-spam tool I paid for. But in the end I switched to a different tool because SpamFire was separate from my e-mail client, and that made it cumbersome to use.

Read the rest of this entry (2,185 words) »

{ Comments on this entry are closed }

Latent semantic analysis is not Bayesian filtering

by Michael Alderete on 5/4/2003

Macworld recently ran an article about anti-spam tools for Mac OS X, which incorrectly simplified the world of anti-spam tools down to Boolean, points-based, and Bayesian filters.

Two additional categories are distributed recognition, such as the Distributed Checksum Clearinghouse (DCC) and Vipul’s Razor, and latent semantic analysis. I don’t know of any distributed recognition products for the Mac (there’s a very good one for Windows Outlook, SpamNet by Cloudmark), but there certainly is a latent semantic analysis tool — Apple’s Mail in Jaguar!

The simplification (or oversight) is relatively understandable. From an end-user perspective, there’s no meaningful difference — even though the math is very different. It’s not clear which will prove better at filtering out spam, even though in the article Mail’s filtering did the best. Seems like it’s good to have both in the fight!

While I’m posting about it, I should note that the article was written prior to the release of my new favorite anti-spam tool, Spamnix, and so it doesn’t include it in the roundup. From my own experience with Mac OS anti-spam tools I think that, with the caveat that it only works with Eudora, it would have done well in the evaluation. Perhaps Geoff Duncan, or someone else at TidBITS, will review it soon, and confirm that guess. I know they like Eudora at TidBITS — they literally wrote the book!

{ Comments on this entry are closed }