Wifi on/off toggle by KM without apple script?

I know using apple script can toggle wifi on/off, but wonder if this is possible done by KM without apple script?

I don't think there's any built-in way to do it, i.e. through a direct KM action. There is an action to set a location, but I don't think setting an interface off or on is part of the stored location data, so that probably wouldn't work.

You can use a Shell Script action (or as you noted, an AppleScript action). This should turn it off:

networksetup -setairportpower en0 off

-rob.

1 Like

Perhaps you will be happy with the Click on Find Image action in KM. Using that action, you can click on the WIFI icon in your menu line at the top of the screen (if it's not there already, it can be enabled). Then you can use your macro to click on the button that toggles WIFI.

This complies with your request "to do it without apple script" and even does it "without shell script" but it does require using the mouse to achieve the result. If you like this solution, and need help writing it, I'm sure one of us can write it for you.