Wifi doesn't work unless I cycle it off then on again coming off of sleep I have a Macbook Pro Retina, 15in, and I have the above issue. In a related question (Wifi doesn&#39;t work unless I turn it off then on again) a user commented:


  For as long as I can remember, I've had to do this on my MacBook Pro
  Retina 15″ — I've always presumed it's the router, as I only have the
  problem at home. I even have a script that will automatically cycle
  the Wi-Fi if it's attempting to connect to my home network and fails
  for more than 3 seconds :) –  grgarside Jan 26 at 20:00


Does anyone know how to write/load this kind of script? Thanks!
You could try something like this: (Copy and Paste it into AppleScript Editor)

--
-- Toggle Airport Power On and Off
--
if (offset of "On" in (do shell script "networksetup -getairportpower en1")) &gt; 0 then
    do shell script "networksetup -setairportpower en1 off"
else
    do shell script "networksetup -setairportpower en1 on"
end if


Change the en1 to en0 (zero) for your WiFi.

If it works save the apple script as application. Pull it to your dock for fast access.