|
#1
| ||||
| ||||
| How to close the Terminal window after a while using AppleScript? 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: tell application "Terminal"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:
|
|
#2
| ||||
| ||||
| An easy and simple Applescript would be: Code: tell application "Terminal" activate do script "ping -c 10 www.vg.no" delay 15 quit end tell Hope that helps!
__________________ Power Macintosh G4/500MHz "Yikes!" 10.4.11 Server • 1024MB • 3 x 120GB + 320GB • DVR-111D • 2 x Radeon 7000 PCI • 2 x 17" CRT MacBook 2.0GHz Core 2 Duo - White 10.5.5 • 2048MB • 80GB • CD-RW/DVD-ROM iPod Photo 60GB • iPod nano 1GB • AT&T DSL 6Mb/768k http://www.jeffhoppe.com |
|
#3
| ||||
| ||||
| Just what I was looking for, thank you. |
|
#4
| ||||
| ||||
| Hehe... glad I could help, and I have to admit, that was my first try at AppleScript programming... ever! I found a couple sites that really helped get that bit of code together with many tips and tricks... I can't remember off the top of my head, but if you'd like them, I'm sure I could find them again and post them here.
__________________ Power Macintosh G4/500MHz "Yikes!" 10.4.11 Server • 1024MB • 3 x 120GB + 320GB • DVR-111D • 2 x Radeon 7000 PCI • 2 x 17" CRT MacBook 2.0GHz Core 2 Duo - White 10.5.5 • 2048MB • 80GB • CD-RW/DVD-ROM iPod Photo 60GB • iPod nano 1GB • AT&T DSL 6Mb/768k http://www.jeffhoppe.com |