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 post
  • 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 post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...