Last active
January 15, 2024 00:50
-
-
Save theotherian/5954592 to your computer and use it in GitHub Desktop.
An AppleScript for toggling wifi on and off
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A script for turning wifi on and off on a Mac |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set status to do shell script "networksetup -getairportpower en1" | |
if status ends with "On" then | |
do shell script "networksetup -setairportpower en1 off" | |
else | |
do shell script "networksetup -setairportpower en1 on" | |
end if |
@NosillaCast nice; glad it helped 👍
it doesn't seems to be working in monterey
error "en1 is not a Wi-Fi interface.
** Error: Error obtaining wireless information." number 10
it doesn't seems to be working in monterey
error "en1 is not a Wi-Fi interface. ** Error: Error obtaining wireless information." number 10
@pradeepb28 replace en1 by en0 and try again should work
Thanks, it works with en0
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Sweet. Just what I needed to add to my Automator app.