Hello all,
I’m looking to run a script that checks for my airport connection status every 10 seconds and is CPU FRIENDLY.
I’ve installed the XNetwork 2.0 scripting addtions, which are working nicely.
My current rendering is as follows:
repeat
try
set ping_result to (do shell script "ping -c 1 google.com")
on error number errNum
if (errNum = 2) then
stop airport
start airport
end if
end try
do shell script {"sleep 10"}
end repeat
This seems to bog my Powerbook G4 down a bit and I’m in hopes that you can help.
Also, I’ve read where if a ping fails, applescript doesn’t stop the ping. Rather, it just stops paying attention to the effort to ping. I’d like to make sure I don’t leave any functions operating in limbo.
How do I do all of this?