Load Images AppleScript Updated for Mavericks Mail.app

I’ve again updated the [Load Images AppleScript](/link/load-images-applescript) that I use with Apple Mail, to load images in email messages using a keyboard shortcut. The script is now compatible with Mail.app in Mavericks (Mac OS X 10.9). This post also explains some changes in Mavericks that affect enabling GUI Scripting, required for the script to work.

I’ve updated the Load Images AppleScript that lets you load images in a Mail.app 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.


The script uses GUI Scripting to trigger the button click. GUI Scripting is a built-in feature of Mac OS X, and it essentially amounts to saying “click the third button of the third scroll area of the first content pane of the top window”. It’s cumbersome, but it lets you activate almost any user interface element.

GUI Scripting is built in, but disabled by default. So, the first thing the Load Images script does is make sure GUI Scripting is turned on. If it isn’t, it asks you to turn it on, by opening the System Preferences app to the appropriate place.

In versions of Mac OS X before Mavericks, GUI Scripting was a global setting, either on or off for the entire system, and the on/off switch was in the Accessibility preference pane. In Mavericks, though, it’s considered a security control, and enabled on an application-by-application basis. Only the apps that need it should be able to use it.

The new security posture is accompanied by a new security dialog, and a move for the controls, to the Accessibility tab of the Security & Privacy preference pane. By default, the list of applications that can use GUI Scripting is empty.

All of this means that the way the Load Images AppleScript tries to activate GUI Scripting has completely changed under Mavericks, and the security dialog that appears is a bit confusing.

Using the Load Images AppleScript with Mavericks

  1. Install the Load Images AppleScript however you want. I provide instructions for using FastScripts on the Load Images AppleScript project page. You might prefer to use Keyboard Maestro, or Alfred, or any of a dozen similar utilities.
  2. In Mail.app, trigger the script.
  3. If GUI Scripting is not enabled, you’ll see the following dialog from the script, explaining that GUI Scripting must be enabled.
    GUI Scripting must be enabled
    Click OK.
  4. Now you’ll see the security dialog.
    FastScripts would like to control this computer
    Click Open System Preferences.
  5. The System Preferences app should open, and display the Accessibility section of the Security & Privacy preference pane. You should see the utility you used to trigger the Load Images script listed, but disabled. It will look something like this.
    GUI Scripting disabled for FastScripts
  6. If necessary, click the padlock icon in the lower-left corner, to allow you to make changes.
  7. Check the box next to your script triggering utility to allow it to use GUI Scripting on your computer. It should look something like this.
    GUI Scripting enabled for FastScripts

And that’s it. Going forward you’ll be able to use the Load Images script via keystroke, without further interruption.