(macOS High Sierra 10.13.6)
I gave up trying to get an Automator script – either a shell (
/bin/bash), or AppleScript syntax, with input type set to no input and available to all applications) working with any keyboard shortcut - function keys or various letter/command/option combinations.
The script would run correctly within Automator, but either produced a beep or no sound at all when using the selected combination.
Additionally the shortcut wasn't always immediately visible, or took a couple of attempts to appear, when adding it System Preferences > Keyboard > Shortcut, so I'm not hugely confident about the reliability of that.
Also I had set the script to be visible to
- I installed the free version of FastScripts
- I copied my AppleScript file to /Users/[myaccount]/Library/Scripts/ – the documentation isn't very clear - if you're trying to figure out 'how do I add a new script?' basically you need to copy it into that directory and it then appears in the UI, there's no New/Add/Create menu or button.
- finally I specified the shortcut in FastScripts' preferences, by double-clicking on the Script.