AppleScript Airport Utility 6.1

Posted on
Tue Jan 29, 2013 7:59 pm
jabeard3 offline
Posts: 52
Joined: Nov 30, 2012

AppleScript Airport Utility 6.1

I have an unknown issue that requires me to reboot my airport extreme base station periodically (ever 4-7 days). I don't know what causes it and frankly I don't care anymore.
I'd like to schedule a restart or the base station every night however I have the base station as well as most of my equipment plugged into a UPS so I can't just plug the base station into an indigo module and cut the power to the module. It seems like it should be pretty simple to write an applescript to do this which I can then schedule via indigo.
Here's a script that I found online that works up to the point of clicking menu item 2 (Restart) This doesn't return an error but nor does it actually restart the device. I've tried naming the menu item rather than referencing the number of the item but I receive an error that it couldn't access menu item Restart of menu bar 1 etc.

activate application "AirPort Utility"
-- * once seems not to be enough
activate application "AirPort Utility"

tell application "System Events"
-- * click on the selected Airport Extreme
perform action "AXPress" of image 2 of group 1 of scroll area 1 of window 1 of application process "AirPort Utility"

-- * wait for the data of Airport Extreme to be loaded in the small popup menu
delay 4
tell application "System Events"
-- * click on the selected Airport Extreme
click menu item 2 of menu "Base Station" of menu bar 1 of application process "AirPort Utility"
end tell
-- * tell process "AirPort Utility"
--* click menu item "Restart..." of menu "Base Station" of menu bar 1
--* end tell
end tell


Anybody have an example script that works?

Posted on
Wed Jan 30, 2013 12:45 am
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: AppleScript Airport Utility 6.1

Try this instead...

Code: Select all
activate application "AirPort Utility"
delay 4
tell application "System Events"
   click image 2 of group 1 of scroll area 1 of window 1 of application process "AirPort Utility"
   delay 3
   click menu item 3 of menu "Base Station" of menu bar 1 of application process "AirPort Utility"
   delay 1
   keystroke tab
   keystroke tab
   keystroke space
end tell

Note that you probably have to have "Enable access for assistive devices" check box checked in the Universal Access control pane for the keystroke commands to work (not sure though).

Posted on
Wed Jan 30, 2013 7:24 am
jabeard3 offline
Posts: 52
Joined: Nov 30, 2012

Re: AppleScript Airport Utility 6.1

Thanks, I'll give it a shot this evening.

Posted on
Wed Jan 30, 2013 9:43 pm
jabeard3 offline
Posts: 52
Joined: Nov 30, 2012

Re: AppleScript Airport Utility 6.1

worked perfectly.
thank you
Jason

Posted on
Wed Jan 30, 2013 10:10 pm
nsheldon offline
Posts: 2469
Joined: Aug 09, 2010
Location: CA

Re: AppleScript Airport Utility 6.1

My pleasure. :-)

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 26 guests