I created this AppleScript to play/pause Youtube videos running on Chrome:
It works fine when I run it from
Automator. I saved the service and added a keyboard shortcut ⌘+
J for running the service. I also added
Automator to the
Accessibility settings (following this SO answer).
Now here's the strange part: it works when I have the
System Preferences window on focus. If I close it, or switch to any other window, the shortcut doesn't work. I noticed that it's working because there's a menu item in
System Preferences window that corresponds to the shortcut, and that is getting triggered when I press the shortcut.
Please help. Thanks in advance.