Я пытаюсь создать приложение на основе appleScript, которое может одним щелчком мыши активировать / деактивировать настройки прокси-сервера Network и Adium.Часть Adium сделана.Чего я не могу сделать, так это сделать оператор switch / if_then_else для выбора между: Network / Location: «Automatic» и «uMinho».Скрипт должен выбрать неактивную опцию.Есть идеи?
Вот сценарий:
-- Activate Location "uminho"
tell application "Finder" to activate
tell application "System Events"
tell process "Finder"
tell menu bar 1
tell menu bar item "Apple"
tell menu "Apple"
tell menu item "Location"
tell menu "Location"
-- Need to switch between "Automatic" and "uMinho"
-- Switch to the unactive one
click menu item "uMinho"
end tell
end tell
end tell
end tell
end tell
end tell
end tell
-- Activate adium proxy settings to all accounts
tell application "Adium" to activate
-- let's do this
tell application "System Events"
tell process "Adium"
-- open prefs
keystroke "," using command down
tell window 1
-- open the accounts pane
tell tool bar 1 to click button "Accounts"
repeat with i from 1 to count of rows of table 1 of scroll area 1
-- tell group 1
-- select the account
set selected of row i of table 1 of scroll area 1 to true
-- edit it
click button "Edit"
-- end tell
tell sheet 1
tell tab group 1
-- open the personal info pane
click radio button "Proxy"
-- change the name, if one was provided
click checkbox "Connect using proxy"
end tell
click button "OK"
end tell
end repeat
keystroke "w" using command down
end tell
end tell
end tell