Re: Ping Script
Re: Ping Script
- Subject: Re: Ping Script
- From: 2551phil <email@hidden>
- Date: Tue, 26 Mar 2013 18:07:04 +0700
I've added a delay to the myFalse handler (I forgot that in the first version, which would make your pinging a bit excessive!)
I've also increased the delay to 30s for both.
You might want to consider an even longer delay, unless being informed within 10 seconds of getting home is vital! ;)
-- infinite ping loop to test for presence of a given IP property server_address : "192.168.1.1" property counter : 0
startPing()
on startPing() try try repeat do shell script "ping -c 1 " & server_address set counter to counter + 1 myTrue() end repeat on error number 2 myFalse() end try on error quit end try end startPing
on myTrue() if counter = 1 then say "welcome home Porter" using "Alex" end if delay 30 return
end myTrue
on myFalse() set counter to 0 delay 30 startPing() end myFalse
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden