Run script on internet connection?

Hi everybody,
I’m wondering how one runs a applescript only after a internet connection has been established?

Please be nice, this is my first post :stuck_out_tongue:

Cheers

One of many ways: (and welcome, too :slight_smile: )


-- Start the script with
repeat
	if count paragraphs in (do shell script "ping -c 1 216.109.112.135") ≥ 5 then
		exit repeat
	else
		delay 1
	end if
end repeat
-- press on with the rest of your script