I want to activate a hotkey in OBS Streamlabs with applescript/osascript.
So this works perfectly fine and as expected using the F17 key (I have a larger keyboard with a numpad):
osascript -e "tell application \"System Events\" to key code 64"
But trying
osascript -e "tell application \"System Events\" to key code 13 using {option down, shift down, command down}"
...doesn't work.
When I type option-shift-command-w manually on the keyboard, however, the hot key is triggered.
Here's the strange thing: I can trigger the hotkey if it's simpler, like "command-w":
osascript -e "tell application \"System Events\" to key code 13 using command down"
Running this command will trigger the command-w global hot key and closes out the current app.
Quoting the curly braces used with the compound modifier keys did not help. I also tried a simpler, 3-keypress combo:
osascript -e "tell application \"System Events\" to key code 13 using {control down, command down}"
This did not work either.
So how can I use multiple modifier keys here?
key code
. Note that it also requires settings under System Preferences > Security & Privacy > Privacy as well.