Jump to content

Toggle Wifi workflow


Recommended Posts

  • 4 weeks later...
  • 3 years later...

I have this bug, that at least once a day my MacBooks internet will stop working. Disconnecting from and reconnecting to wifi will usually fix this quickly. Therefore I adjusted this script slightly:

 

on alfred_script(q)
    set wifi to (do shell script "networksetup -listallhardwareports | grep -A 1 Wi-Fi | tail -n 1 | cut -b 9-12")
    do shell script "networksetup -setairportpower " & wifi & " off"
    do shell script "networksetup -setairportpower " & wifi & " on"
end alfred_script

It will now turn off wifi and instantly turn it back on again. Therefore running this workflow fixes my internet within a couple seconds.

Link to comment
  • 2 weeks later...

Hey Janshi

 

Your problem sounds like an issue with your wifi-network. I hope you find a solution for it.

 

Concerning your script: I think you'd be better off creating a new custom workflow for it, since it does something completely different to the toggle-wifi script.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...