Keyboard shortcuts for AppleScripts in Snow Leopard?

In Mac OS X 10.6 Snow Leopard, the keyboard-shortcuts system has been enhanced in various ways. But now I can't seem to assign a shortcut to an AppleScript.

I also can't find any information about this online—in particular, I can't figure out whether it's user error on my part or a change in the OS. Articles I've looked at have fallen into any of several categories:

  • Written years ago, when AS filenames indicated keyboard shortcuts.
  • Written for Leopard, when assigning keyboard shortcuts to scripts worked just like assigning keyboard shortcuts to other menu items.
  • Recommendations to use Quicksilver, Mail Act-On, or FastScripts.

I'd be willing to use one of those utilities, but before I download and install and learn to use a third-party system, I'd like to find out whether the capability I need is built into the operating system, as I think it was in previous versions. I know that Quicksilver is supposed to be the perfect all-purpose tool for every occasion, but for my particular purposes right now it seems kind of like swatting a fly with a hand grenade, or fixing a toaster by remodeling the kitchen.

As a side note, I was rather surprised to be unable to find any page that compares and contrasts Quicksilver and Mail Act-On. I know that Quicksilver does a bunch of stuff that's way outside the scope of Mail Act-On; I'm not clear on whether Mail Act-On does anything that Quicksilver doesn't (or does anything better). Likewise with FastScripts: is there a reason to use that instead of (or in addition to) Quicksilver, other than Quicksilver's general vastness?

Anyway, my main question here is: should it work to assign keyboard shortcuts to AppleScripts (for in Snow Leopard? If so, is there anything special I need to do to make that work? I carefully checked the spelling of the script name two or three times, and tried a couple of different script names, and tried both an app-specific script and a user-specific script, but couldn't get the keyboard shortcut to show up in the script menu. (And yes, I quit Mail and restarted it after each attempt.)

10 Responses to “Keyboard shortcuts for AppleScripts in Snow Leopard?”

  1. joe

    I am very much interested in this… actually have the same exact problem. I have an applescript that sends messages to the app Hit List – and works perfectly in snow leopard when ran from the applescript menu list. I am just unable to assign a keyboard shortcut to it.

    • Jed

      My current semi-solution is to use Quicksilver, but it’s not a solution I’m entirely happy with.

  2. Chris Janton

    Create an Automator “Service” which runs an AppleScript

  3. Daniel Marino

    I’m irritated that I couldn’t just assign a keyboard shortcut to the AppleScript, but creating an Automator “Service” did the trick.

  4. jkleis

    I would also wish that apple did make it possible to easily assign shortcuts to applescripts – especially since the automator solution seems to be quite slow.

    At least I hopt that Apple will optimize the process even further. Another issue that annoys me, is that I cannot search for the service that I want to make a shortcut for – and sometimes it takes rather long time to locate the service.

    In this_service, it was possible to assign a shortcut directly from the application – I hope that Apple will implement this possibility in Automator. Unfortunately, I suspect they wait until 10.7…

  5. Dan

    I used Automator to run a shell script but can’t assign a shortcut key to it when I select it under “Services” in the keyboard shortcut menu. I also can’t find any good documentation on this. Is it broke in Snow Job… I mean Snow Leopard?

  6. Michael

    I know this is rather old, but I thought I would throw this out there. I’m not sure if this is the same for all apps or just a handful (but I think it is a longstanding Apple thing). Anyway, if you want keyboard shortcuts for your scripts in the Applescript menu, you need to add them to the file name. So each meta key has an single letter abbreviation, s is for shift, o is for option, c is for control, and m is for command. So if you want your script to be triggered by CTRL-OPT-V then when you put your script into the proper folder, you name it: Script Namecov
    Or for SHIFT-CMD-M: Script Namesmm
    If you wanted CTRL-M you could use cm. Since you can’t have the script triggered with only two meta keys, the m is used to mean the letter m and not the command key. Hope this helps.

    • Jed

      Thanks, but my understanding is that that approach no longer works in recent versions of Mac OS. (That’s what I was referring to in the part of the entry where I said “Written years ago, when AS filenames indicated keyboard shortcuts.”) But I would be happy to be wrong about this.

  7. scot.finnie

    Jump ahead 5 years. I’m running Yosemite {10.10). Michael’s comment is as true today as it was in 2010. You *can* assign keyboard shortcuts to AppleScripts by using the backslash character () and a specific arrangement of letters as part of the filename of the script, like so:

    script-namesmM.scpt assigns SHIFT-CMD-M (the letter M)
    script-namescM.scpt assigns SHIFT-CTRL-M
    script-namesoM.scpt assigns SHIFT-OPTION-M
    script-namecmM.scpt assigns CTRL-CMD-M
    script-namecoM.scpt assigns CTRL-OPTION-M
    script-namemoM.scpt assigns CMD-OPTION-M

    The letter M isn’t the only keystroke this works with. Note: It is possible to conflict with OS X system-wide and app-specific keyboard shortcuts.

    • Jed

      Thanks! I no longer need to do this (I use Mail Act-On now), but good to know for future reference.

      (And sorry your comment got stuck in moderation for a couple weeks.)


Join the Conversation