Custom keyboard shortcut doesn't work in Preview
I used "Run Shell Script" in Automator to make a custom keyboard shortcut to toggle WiFi on/off:
⌃⌥⌘W
I set it to:
Workflow receives no input in any application
and used the script:
if [[ `networksetup -getairportpower en0` == *On ]]
then
networksetup -setairportpower en0 off
else
networksetup -setairportpower en0 on
fi
This works in apps such as Firefox, but does nothing in Preview.
How can I make it work in Preview?
Thanks.
MacBook Air, macOS 14.2