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.
Background
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
- 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.
- In Mail.app, trigger the script.
- If GUI Scripting is not enabled, you’ll see the following dialog from the script, explaining that GUI Scripting must be enabled.
Click OK. - Now you’ll see the security dialog.
Click Open System Preferences. - 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.
- If necessary, click the padlock icon in the lower-left corner, to allow you to make changes.
- 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.
And that’s it. Going forward you’ll be able to use the Load Images script via keystroke, without further interruption.