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

Posted on Feb 11, 2025 5:53 AM

Reply
2 replies

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Custom keyboard shortcut doesn't work in Preview

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.