Scripting Airport UTILITY to choose TC setup

I have latest Timecapsule 2TB. Most routers and network drive offerr setup via an HTTP interface ; this has been said already, TimeCapsule has no web-based setup.

I have created 2 setups on my TimeCapsule, one with wif-fi activated, the other without.


My problem is the following : how can I remotely choose one or the other setup ?


Of course I'll need two actions to perform this : step 1 : choose correct setup / Step 2 : reboot TimeCapsule.


My thinking was to create an AppleScript and there is my point : I have no clue of what parameter I should use to create such a script ! Live Recording of an Applescript gives nothing else but "open the AirPort Utility"... then no action is beeing taken into the script.


Would someone have the same needs or do you think I could write a script to perform these actions ?


I was aso hopping to launch this AppleScript from iPhone (as an OS X APP launched from a remote APP on the iPhone).... but this is too big at this point.

I would be happy enough if I had the script.


Thanx for the help

Posted on Sep 11, 2011 2:53 AM

Reply
2 replies

Aug 1, 2012 12:16 PM in response to xzu

I have the same challenge.


For Airport Utility (5.6?) in Snow Leopard

I used a script I made, but it doesn't work in Airport Utility 6+, the menu's are different.


Now I'm figuring out how to script the new version, but it's very difficult. It almost looks like Applescript doesn't work with the buttons and tabs in Airport Utility anymore.


So, if you have something, it would help me as well.


I have tried using the import and export files. They work (better than in 5.x) but are of no use to me, because I am not able to script importing them.


RLB2


tell application "AirPort Utility"


activate

end tell


tell application "System Events"


delay 3

click menu item "Manual Setup" of menu "Base Station" of menu bar 1 of process "AirPort Utility"


delay 1




-- * Set Wireless on and set the name to 'Straling'



-- Select menu Airport, to change wifi settings

click menu item "Airport" of menu "Settings" of menu bar 1 of process "AirPort Utility"


delay 3



clickradio button "Wireless" of tab group 1 of window 1 of application process "AirPort Utility"


delay 1



-- Set Wireless mode to ON

click pop up button "Wireless Mode:" of tab group 1 of window 1 of application process "AirPort Utility"

tell menu 1 of pop up button "Wireless Mode:" of tab group 1 of window 1 of application process "AirPort Utility"

click menu item "Create a wireless network"

end tell



-- Set Wireless Network name to Straling

set value of text field "Wireless Network Name:" of tab group 1 of window 1 of application process "AirPort Utility" to "Straling"



-- * Set the Internet connection to Bridge Mode *



-- Select menu "Internet"

click menu item "Internet" of menu "Settings" of menu bar 1 of process "AirPort Utility"


delay 1


click pop up button "Connection Sharing:" of tab group 1 of window 1 of application process "AirPort Utility"

tell menu 1 of pop up button "Connection Sharing:" of tab group 1 of window 1 of application process "AirPort Utility"

click menu item "Off (Bridge Mode)"

end tell



-- * Update settings


delay 1

click button "Update" of window 1 of process "AirPort Utility"



delay 1

if (exists button "Continue" of sheet 1 of window 1 of process "AirPort Utility") then

click button "Continue" of sheet 1 of window 1 of process "AirPort Utility"

end if




-- * Quit Airport utility


delay 2

tell application "AirPort Utility" to quit


end tell

Aug 7, 2012 12:03 AM in response to Rlb2

For Scripting Airport Utility 6.1, I have made the following script.


1.

Be sure to set System Preferences -> Accessibility -> Enable Acces for assitive devices to 'ON'

2.

Configure your Time machine or Airport Express the way you want, and make a configuration file.

The Export command is clickable in the File menu item, (only) when you are editing your Airport Machine.

Save it somewhere and in the Finder get the correct path, copy it from the 'Get Info' pane (general -> where)

Put the path into this script, find my path and substitute it with yours.

3.

Start the script



Thanks to UIBrowser for their Mountain Lion version!

http://pfiddlesoft.com/uibrowser/


Rene



activate application "AirPort Utility"

-- * once seems not to be enough

activate application "AirPort Utility"


tell application "System Events"


-- * click on the selected Airport Extreme


performaction "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



-- * click on the edit button

perform action "AXPress" of button "Edit" of group 1 of pop over 1 of image 2 of group 1 of scroll area 1 of window 1 of application process "AirPort Utility"



-- * open file import dialog

click menu item "Import Configuration File..." of menu 1 of menu bar item "File" of menu bar 1 of application process "AirPort Utility"



-- * in the finder dialog, go to the correct config file

set posixpath to "/Users/yourname/Documents/Wifi/WirelessOn.baseconfig"

tell window 1

tell application "System Events"


keystroke "g" using {shift down, command down}


keystrokeposixpath

delay 1


keystrokereturn

end tell

end tell



-- * click the open button in the import dialog

click button "Open" of sheet 1 of sheet 1 of window 1 of application process "AirPort Utility"



-- * Update the Airport

click button "Update" of sheet 1 of window 1 of application process "AirPort Utility"


delay 4





-- * Quit Airport utility


delay 2

tell application "AirPort Utility" to quit



end tell

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Scripting Airport UTILITY to choose TC setup

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.