Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Version 3 | 13 comments | Create New Account
Click here to return to the 'Version 3' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Version 3
Authored by: Diggory on Mar 03, '04 07:39:20AM
It would be nice if someone who uses proxies could check to see if it works as expected.

on idle
	set secondsToWaitBetweenChecks to 120 -- 2 Minutes between checks
	
	set availText to "Your Network Connection is now available."
	set unavailText to "The network is still down."
	
	set hostToCheck to "www.apple.com"
	set checkNetScript to "scutil -r " & hostToCheck
	
	
	try
		set netStatus to do shell script checkNetScript
		if netStatus is "Reachable" then
			my announceText(availText)
			activate
			quit
		else
			--		my announceText(unavailText)
		end if
	on error
		display dialog "Could not check the net status this time." buttons {"OK"} default button 1 giving up after 5 -- seconds
	end try
	return secondsToWaitBetweenChecks
end idle




to announceText(textToSpeak)
	tell application "System Events"
		
		--	If iTunes is running dip the Audio.
		if (exists process "iTunes") then
			tell application "iTunes"
				set oldVolume to sound volume
				set sound volume to (sound volume * 0.25)
				delay 1
				say textToSpeak
				delay 1
				set sound volume to oldVolume
			end tell
		else
			say textToSpeak
		end if
		
		--	If the User has Salling Clicker show a funky alert.
		if (exists process "SEC Helper") then
			tell application "SEC Helper"
				show screen message textToSpeak
			end tell
		else
			display dialog textToSpeak
		end if
		
	end tell
end announceText

---
*****
monkeyfood software - http://www.monkeyfood.com

[ Reply to This | # ]

Proxies...
Authored by: amacaulay on Mar 07, '04 06:47:05AM

There are options for controlling how you connect to a proxy, but these are more for when you _do_ want to and won't help you bypass the transparent proxies that many ISPs use.

However, if you use the --header option to send an appropriate Pragma: header (perhaps someone who understands this part of http can leap in here), then a well behaved proxy should let you pass through.

That said, the original script was to test whether your line was up, so as long as you don't run a home proxy server (or have one on site between your machine and the outside Internet) then why bother? A returned page must have come over your Internet line, so your line must be up.

Andy.



[ Reply to This | # ]