• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Ping Script
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Ping Script


  • Subject: Re: Ping Script
  • From: 2551phil <email@hidden>
  • Date: Tue, 26 Mar 2013 09:32:45 +0700

On 26 Mar 2013, at 11:41, Porter Slice <email@hidden> wrote:
It works the first time, but I want the script to continually run and listen for that ip address

Then you'll need to write a launch deamon for it. See here for an easy tutorial:

http://nathangrigg.net/2012/07/schedule-jobs-using-launchd/


without annoying me by welcoming me home every ten seconds. 

Define some property with the value "0". Put an if test at the beginning of the repeat loop that says if the value is 1 then exit (don't do the rest of the loop), if the value is 0 do the rest of the loop. After the ping test, make sure you set that property to 1 when the ping is successful (and exit) or sets it to 0 ( and repeat) if it's not. 

On success, the repeat loop will stop, but the script will run again according to the interval you define in the 'StartInterval' key of the launchd plist.


Best

Phil
http://applehelpwriter.com

 _______________________________________________
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

  • Follow-Ups:
    • Re: Ping Script
      • From: Christopher Stone <email@hidden>
References: 
 >Ping Script (From: Porter Slice <email@hidden>)

  • Prev by Date: Re: The variable speak hour is not defined
  • Next by Date: Re: Ping Script
  • Previous by thread: Ping Script
  • Next by thread: Re: Ping Script
  • Index(es):
    • Date
    • Thread