I want to have AppleScript activate/deactivate a plugin, using a keyboard command.
I have set the keyboard command in Google Chrome > Settings > Extensions > Keyboard shortcuts and it works when I do it manually. For this example, I'm using Shift + Alt + U.
I've tried a few variants of this script.
tell application "Google Chrome" to activate
tell application "Google Chrome" to key code u using {option down, shift down}
delay(1)
tell application "Google Chrome" to keystroke "r" using command down
The last past refreshes the window, and it works – but not the second line which is supposed to toggle the extension. Again, I can toggle the extension manually with Shift + Alt + U, but the script won't do it,
I also tried this:
tell application "Google Chrome" to keystroke "u" using {option down, shift down}
Is the script actually supposed to work, making the problem reside somewhere else, or is there something wrong in it?