Automatic Background Ping (Pinging)

Discussion in 'macOS' started by LeonJames17, Mar 28, 2008.

  1. LeonJames17 macrumors newbie

    Joined:
    Mar 28, 2008
    #1
    Hi there,

    I have recently changed to a wireless vodafone service, which 'idles' your connection if you haven't loaded a webpage after a couple of seconds.. This idle can take a minute or so to get out of and is very frustrating...

    Does anyone know of a program or way to get Mac OS X Leopard to ping an address at 1 second intervals?

    I read this keeps the connection open on a Vodafone forum, but the person was using a Vista computer... I can't find a similar software for Mac!

    Any help would be appreciated!
     
  2. mackindergarten macrumors 6502

    Joined:
    Feb 21, 2008
    #2
    Hi,

    save this script as application and it'll do the job for you.

    Code:
    try
    	repeat
    		do shell script "ping -c 1 www.google.com"
    		delay 1
    	end repeat
    end try
    Adjust the delay (in seconds) if you need to.

    Hope this works for you.
    /Rupert
     
  3. LeonJames17 thread starter macrumors newbie

    Joined:
    Mar 28, 2008
    #3
    Thanks Rupert!

    Sorry to sound stupid... I've used a macs for only a year.... How would I save that as a application?

    Thanks for your help!
     
  4. mackindergarten macrumors 6502

    Joined:
    Feb 21, 2008
    #4
    Hi,

    no worries.

    You need to open Script Editor (/Applications/AppleScript/Script Editor.app) and paste this code.

    In Script Editor go to File > Save As and choose Application as File Format.
    Be sure to uncheck Startup Screen, as it would give you a "nag-screen" every time you launch it.

    Save it to any folder you like.

    Another hint: You can use this post over at Mac Kindergarten - on launching multiple items - to launch your browser and this application together.

    /Rupert
     
  5. LeonJames17 thread starter macrumors newbie

    Joined:
    Mar 28, 2008
    #5
    Wow that was surprisingly easy..

    However when launched I see my modem light up for about 5 seconds, and I notice my cursor turns into a circle divided into quarters (black and white, similar to a bmw logo), and if I press on the application in my dock it has in a grey lettering 'Application Not Responding'.

    Any suggestions?
     
  6. mackindergarten macrumors 6502

    Joined:
    Feb 21, 2008
    #6
    Hi,

    it's because this quick application (read: hack) is running in an endless loop.
    This will do better:
    Code:
    on idle
    	do shell script "ping -c 1 www.google.com"
    	return 1
    end idle
    
    EDIT: Save it as application with Stay Open checked.

    /Rupert
     

Share This Page