Ask Different is a question and answer site for power users of Apple hardware and software. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I found a script on this site which I edited to make work with Mountain Lion, I thought. It works fine from Automator, but when I save as a service and assign a keystroke to it, it does not. Any help would be appreciated!

tell application "Mail" to activate

tell application "System Events"
    tell process "Mail"
        tell application "System Events" to keystroke "," using command down
        delay 0.1
        activate (first window whose name is "Viewing")
        click checkbox "Use classic layout" of group 1 of group 1 of window "Viewing"
    end tell
end tell
share|improve this question

The script didn't focus the Viewing tab. Try this instead:

activate application "Mail"
tell application "System Events" to tell process "Mail"
    keystroke "," using command down
    tell window 1
        click button "Viewing" of tool bar 1
        click checkbox "Use classic layout" of group 1 of group 1
        click button 1
    end tell
end tell

If it still doesn't work, it might be because of a bug where the shortcuts for Automator services don't always work until you hover the services menu from the menu bar. See this question for other ways to assign shortcuts to scripts.

share|improve this answer
Thanks! That script indeed works from within Automator as my other did, but does not work from within Mail via keystroke. I'll look into other ways assign the shortcut. System Preferences works for my other scripts...oh well. – Evin Carvill-Ziemer Jun 27 '13 at 0:45

Fixed it! It turns out that a service has to be accessed once from the drop down menu. Then it will work with a short cut...finally!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.