26

After I assign a keyboard shortcut to initiate a service in System Preferences, I press the keyboard shortcut and nothing happens. I have to first click on the service title under the services menu (found if you click on the application title in the top left corner of the screen). Only then will the keyboard shortcut function correctly.

If I quit that application, I have to manually click on the service title under the services menu each and every time I re-open the application. I would've thought that the fix would "last" until the computer is shut down or restarted, but nope, it lasts only until the application is quit out of.

It may sound as though I am making a mountain out of a molehill, but this extra step essentially defeats the purpose of the keyboard shortcut in the first place, especially since I usually do not know and cannot keep track of if I have already manually run the service since the last time that I opened that application.

I have to repeat these steps for every application, including stock applications like Finder. Otherwise, the shortcut will not work while I am in that application.

This happens for every service I created.

This happens regardless of the keyboard shortcut.

Is there any way to have the keyboard shortcut trigger the service without having to manually run the service first?


My computer runs OS X El Capitan, version 10.11.6. It should be noted, however, that I first observed this bug from the very first time that I assigned a keyboard shortcut to my service, which was at least a year ago. In other words, I have never experienced the keyboard shortcut function as it was designed to work.


It should be noted that this bug is not unique to my computer; reports of others experiencing this idiosyncrasy abound on the internet...

Service not running the first time it's invoked via key combination

Services shortcut not working properly

Assigning a shortcut to a service

Assign a shortcut to running a script in OS X (read the last paragraph in this answer)

rubik's sphere
  • 5,610
  • 13
  • 56
  • 109
  • 1
    That totally is not how it is supposed to work. Sadly I can't think of a good way to fix or troubleshoot this issue. What if you try to make the shortcut something that no application could possibly use. Like cmd+shift+alt+ctrl+0? – Joonas Nov 11 '16 at 09:08
  • I assigned the shortcut, cmd+shift+alt+ctrl+0 to initiate a service, as suggested. I still had to manually run the service before this shortcut did anything. – rubik's sphere Nov 11 '16 at 16:37
  • Maybe if you reinstall(repair) the OS. If you don't format the drive, it'll keep everything and just rewrite all system files. That could work... Well, this next one is not really a solution to the problem, but perhaps a way to get around it. This is totally not the only application, but a pretty decent free one: Aptivate 2. I've maybe once tried it, but it should do the trick. There are many alternative applications that do what Aptivate does. I personally use Alfred mostly – Joonas Nov 11 '16 at 20:34
  • Please add the OS X/macOS version information to your question, e.g. OS X El Capitan 10.11.6 or macOS Sierra 10.12.1, etc. – user3439894 Nov 29 '16 at 22:32
  • @user3439894 I've updated my post to include my operating system. – rubik's sphere Nov 30 '16 at 01:39
  • same here with 10.12.6 – ChaosPredictor Aug 12 '17 at 17:43
  • 2
    Have you tried a force rescan of all the Services on your computer? You can do so by running /System/Library/CoreServices/pbs -update. Information at the bottom on this page of Apple's Developer Reference. – Bruce Sep 12 '17 at 02:56
  • @Bruce The provided Terminal command only works temporarily and on a per-app basis. That is, when that app is quit and reopened, the keyboard shortcut will stop working again. Also, this workaround is no more convenient than the one that I articulated in the OP. (In fact, I think it is less convenient.) – rubik's sphere May 22 '18 at 07:31
  • @rubik's-sphere It's only temporary? That sucks. One random idea of a complete hack: set up a launchd daemon that watches the Applications folder or just runs every 5 minutes or so to trigger the command in the background. – Bruce May 24 '18 at 19:34
  • Good to point out! In addition, there is another bug: for certain versions of MacOS (e.g., my 10.13.6 "High Sierra"), the hotkey does not work if desktop or Finder is in focus, however, it works when any other application is in focus. Well, this is acceptable because MacOS is always full of bugs which mostly does not affect normal usage. – xuancong84 Jan 17 '19 at 10:34

4 Answers4

18

Found the answer in this Apple Support Community thread:

Keyboard shortcuts for services will only work properly if they have a ⌘ command key in them. That is, cmd-ctrl-k works, but ctrl-k needs help. The "help" is to go to the app's menu bar and hover over the services so it sees them. That works until you quit the app.

But, if the shortcut contains the ⌘ command key, it works as expected.

rubik's sphere
  • 5,610
  • 13
  • 56
  • 109
  • 2
    +1 for this peculiar workaround. I've tested it on my machine and it works; if the keyboard shortcut happens to contain the cmd key, then the Service always launches, even if the Service has not been manually triggered. The downside of this workaround is that virtually all ⌘ command + single letter keyboard shortcuts are occupied by default application shortcuts, which means that one must incorporate a third key to create a unique shortcut. The reason that I prefer the ⌥ option and ⌃ control modifier keys is because then I can implement keyboard shortcuts that consist of only two keys. – rubik's sphere Sep 22 '18 at 00:04
  • I had to add the Opt key (including CMD) to my shortcut to get it to work on macOS Catalina. – Tony Barganski Apr 09 '20 at 05:24
  • Thank you for this! My ctrl-shift-s shortcut was not working unless I opened the menu, but setting it to cmd-ctrl-s seems to be working great.

    When Control is mapped to the Caps Lock key, it can combine really nicely with the Command key.

    – brookr May 07 '20 at 06:12
  • Mine use ⌘ command and still have this problem – Unrelated Aug 28 '20 at 19:31
  • Also having this problem on Big Sur even when using ⌘ key. – cody.codes Jan 21 '21 at 18:41
4

In my case, I had to change the shortcut from ctrl-option-cmd-L to shift-option-cmd-L before the shortcut would trigger.

If adding cmd to the shortcut doesn't work, try substituting a different modifier key for the ctrl.

StrawHara
  • 4,893
  • Thanks! My shortcut was ⌘ command + $ but after changing to ctrl + $ and then back to ⌘ command + $ it worked all of a sudden! – FooBar Dec 30 '21 at 10:00
2

I have come up with this workaround: Use

System Preferences -> Keyboard -> Shortcuts -> App Shortcuts enter image description here There you have to spell out the name of your service. In contrast to Shortcuts -> Services this actually works for me.

  • Thank you! This worked for me. I had to export the shortcut as a Quick Action > Services Menu, and then type in the exact name there into the screenshot you've shown, and it finally works in any app. That was needlessly complex, but it works. – compilererror Jan 07 '24 at 20:29
0

For me the keyboard shortcuts finally worked when I removed the option for "Provide Output" in the Shortcut. Nothing else helped. Did this on macos Sonoma 14.4.1

enter image description here

If it still not works I suggest creating a new empty Shortcut with a simple alert and add a keyboard shortcut to see if at least that runs.

qtips
  • 101