Pick of the Week - Nov 10 [Show all picks]
Path Finder 5 - A feature-laden Finder replacement
Submit Hint Search The Forums LinksStatsPollsFAQHeadlinesRSS
12,000 hints and counting!

10.5: An AppleScript to restart an AirPort Base Station Network
After reading my Airtunes hint, several people have asked me to post a script to restart an AirPort Base Station ... so here it is. The script assumes you can at least see the Base Station in AirPort Utility, which is not always the case so YMMV. You can use the launchd utility or Cronnix if you prefer to schedule it. If you have a shell script for this, please share as I think that would be a more elegant solution.

Meanwhile, here's the AppleScript: [robg adds: I haven't tested this one.]
    •    
  • Currently 0.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (0 votes cast)
 
[9,641 views]  

10.5: An AppleScript to restart an AirPort Base Station | 9 comments | Create New Account
Click here to return to the '10.5: An AppleScript to restart an AirPort Base Station' hint
The following comments are owned by whomever posted them. This site is not responsible for what they say.
10.5: An AppleScript to restart an AirPort Base Station
Authored by: Lutin on Sat, Jan 5 2008 at 12:16PM PST
Tested.

It works fine, and will be convenient.

Thank you.

[ Reply to This | # ]
Script for Tiger
Authored by: leamanc on Sat, Jan 5 2008 at 10:19PM PST
You mention there is a different script for Tiger. Do you have a website where it is available, or can you post it in the comments here?

[ Reply to This | # ]
Script for Tiger
Authored by: MeIr on Mon, Feb 18 2008 at 9:41AM PST
I tested, works on Tiger just fine.
No need for any modifications.

[ Reply to This | # ]
10.5: An AppleScript to restart an AirPort Base Station
Authored by: BCooper202 on Sun, Jan 6 2008 at 5:22AM PST
I have two airport stations in my house: an Airport Extreme (named "Airport Bedroom") and an Airport Express (named "Express - Living Room"). When Airport Utility is launched, Airport Bedroom shows at the top of the list, and Express - Living Room is second.

The script works fine in selecting the first one to show in the list: Airport Bedroom.

But when I duplicated the script and tried to tweak it to pick the second it doesn't work -- always picks the first of the two in the list.

The tweak I did was in the line tell window 1 --"AirPort Utility - Extreme Base" -- I changed "Extreme Base" to "Express - Living Room".

But it still picks the Airport Bedroom at the top of Airport Utility's list.

Any clues as to how to fix?



[ Reply to This | # ]
10.5: An AppleScript to restart an AirPort Base Station
Authored by: sweyhrich on Sun, Jan 6 2008 at 8:18AM PST
I found it necessary to make a couple of adjustments (sorry, don't have a solution to the problem of selecting which base station). If it happens that Airport Utility is already open, and the Manual Setup has already been selected, I had the script fail with an error. Instead of these lines:

tell window 1
    click button "Manual Setup"

I replaced them with these lines:

tell menu bar item "Base Station"
    tell menu 1
        click menu item "Manual Setup"
        delay 10
    end tell
end tell

I also increased the delay after activating the script to delay 10, and the delay after "say 'Restarting Airport'" to 5, which works better with my setup. Great script! My airport base station seems to disappear from my laptop after a couple of days, making printing wirelessly impossible to the printer attached to the wired computer connected to the ethernet on the base station. Restarting the station fixes it, so I've got the "Restart Airport" script set to automatically run every morning at 2 am.

---
Steven Weyhrich
http://apple2history.org

[ Reply to This | # ]

10.5: An AppleScript to restart an AirPort Base Station
Authored by: ijksail on Sun, Jan 6 2008 at 2:58PM PST
This script worked as described for me.

I find that my USB Air Disk I have hooked up has been inconsistent in its function.
I frequently lose the ability to Log in to the password protected disc. Rebooting has been the only solution.
The disc can always mount as a guest user.
This happens enough that I made this script an application that I assigned a HotKey with Quicksilver.

Any suggestions other than rebooting?

[ Reply to This | # ]
10.5: An AppleScript to restart an AirPort Base Station
Authored by: u2mr2os2 on Tue, Jan 8 2008 at 9:23AM PST
I think this hint assumes that you have saved your base station password in your keychain so that the Airport Utility does not prompt for a password.

[ Reply to This | # ]
10.5: An AppleScript to restart an AirPort Base Station
Authored by: Schwie on Mon, Feb 18 2008 at 11:21AM PST
I had to check the box "Enable access for assistive devices" in the "Universal Access" System Preference before this would work. Very slick and I like the audio feedback after the script has run :)

Brad

[ Reply to This | # ]

10.5: An AppleScript to restart an AirPort Base Station
Authored by: Schwie on Mon, Apr 21 2008 at 11:31AM PDT
Actually, just to clarify... My applescript would never launch with cron, because my screensaver always interfered and something with user permissions too. Rather than figure out how to simulate a mouse click and resolve the permissions issue, I ended up just having iCal do it for me and everything was peachy.



[ Reply to This | # ]