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


Click here to return to the 'If behind a proxy server ...' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
If behind a proxy server ...
Authored by: tbolt502 on Mar 01, '04 02:15:13PM
Just a wee pointer, if you are behind a proxy server, these settings will not transfer to this shell script and it seems it must be explicitly included.

on idle
  try
    do shell script "curl --proxy name_or_IP_of_proxy_server:port www.apple.com"
    say "Your DSL is now available"
    display dialog "DSL now available."

    on error
      -- say "DSL still down."
  end try
  return 120
end idle
(The "-x" flag does the same as "--proxy" as well.)

If anyone knows how to get Apple Scripts to pick up the network environement, please let us know!
Cheers.

[ Reply to This | # ]

If behind a proxy server ...
Authored by: tbolt502 on Mar 01, '04 02:22:20PM
Another addition.

In a previous hint, the author had iTunes turn down the volume before speaking.

I think this was a nice touch and use it often in scripts.
This would then become:


on idle
  try
    do shell script "curl www.apple.com"
		tell application "iTunes"
			set sound volume to 15
			delay 1
			say "Your Network Connection is now available"
			display dialog "Network Connection now available."
			delay 1
			set sound volume to 75
		end tell

    on error
      -- say "DSL still down."
  end try
  return 120
end idle
Cheers.

[ Reply to This | # ]
If behind a proxy server ...
Authored by: geordie on Mar 01, '04 06:40:41PM
Thanks for the hint about lowering the volume. However, no offense, that is just wrong to do it. You should never reset something to a different value than what it was before you started. Use the lines:

   set oldVolume to sound volume
   set sound volume to 15
   ...  say stuff ....
  set sound volume to oldVolume
I would actually probably set it to 20% percent of the previous volume instead of static value of 15 in the second line as well, but that is more a personal taste thing.

[ Reply to This | # ]