Im completely new to applescript so take it easy on me please.
Issue is that I need to change the airport wep password each day as customers at a cafe are given this for free and then turn up outside (not buying coffee!) day after day sucking up the bandwidth. Thought perhaps I could get applescript to suck the values out of a csv tab delimited file depending on the day of the month. So on the 1st the wep password would be 0123456789, the 2nd 9998887771 etc.
I did read on a post that airport admin utility is not very scriptable so is this a non-starter?
Thanks in advance for any assistance.
The Airport Admin Utility is not scriptable at all except by using System Events to script its GUI. I don’t have an AirPort (so for me it sticks at the select base station window), but someone who does can lead you through the steps to reconfiguring it if the GUI is relatively straight-forward.
Airport Utility isn’t really scriptable, but with GUI scripting you can do it.
It works only with Airport Utility Version 5
There is a dummy handler getNewPass(), you must replace is with your routine to get the data
property baseStation : "myStation"
property pass_word : "¢¢¢¢¢¢"
set newPass to getNewPass() -- dummy handler to get passwort from .csv
activate application "AirPort Utility"
if character 1 of (get version of application "AirPort Utility") as integer < 5 then return -- Versioncheck
tell application "System Events"
tell process "AirPort Utility"
tell window 1
tell (1st row of table 1 of scroll area 1 whose value of text field 1 is baseStation)
set value of attribute "AXSelected" to true
keystroke "l" using command down
set x to 20 -- delay if password is taken from keychain and sheet doesn't appear
repeat until (exists sheet 1) or (x is 0)
set x to x - 1
if x > 0 then
tell sheet 1
click button "OK"
repeat until exists tab group 1
tell tab group 1
click radio button "Base Station"
repeat until button "Base Station Options." exists
set value of attribute "AXFocused" of text field 2 to true
keystroke newPass & tab & newPass
click button "Update"
repeat until (exists group 1) and (value of static text 1 of group 1 contains "You can close")
quit application "AirPort Utility"