voice-
Registered
I'm writing a newbie AppleScript ping application, the intention is to check internet connection with only one click. So far, the code looks like this:
As you've probably guessed, this opens Terminal and pings vg.no 10 times.
Now I want to add a little simplicity. I want it to bring Terminal to the front when I run the script, and I want it to close Terminal 10 seconds after the ping is successful/unsuccessful. This should allow plenty of time for me to see if I'm connected. Could anyone please tell me how to do this? I can quit the Terminal, but I can't make it wait first.
In summary, what I want is for the AppleScript to:
tell application "Terminal"
do script "ping -c 10 www.vg.no"
end tell
do script "ping -c 10 www.vg.no"
end tell
As you've probably guessed, this opens Terminal and pings vg.no 10 times.
Now I want to add a little simplicity. I want it to bring Terminal to the front when I run the script, and I want it to close Terminal 10 seconds after the ping is successful/unsuccessful. This should allow plenty of time for me to see if I'm connected. Could anyone please tell me how to do this? I can quit the Terminal, but I can't make it wait first.
In summary, what I want is for the AppleScript to:
- Open Terminal
- Ping a webserver
- Bring the Termianl to the front (or otherwise bring the result to the front)
- Close whatever result it gets after 10 seconds