1

システム環境設定の「ネットワーク」設定の「詳細」メニューで「Web プロキシ」および「セキュア Web プロキシ」オプションを有効にする Applescript を作成しようとしました。

これまでの私のアップルスクリプトは次のとおりです..

tell application "System Preferences"
activate
set current pane to pane "com.apple.preference.network"
end tell

tell application "System Events"
tell application process "System Preferences"
    tell window "Network"
        click button "Advanced…"
        tell tab group 1 of sheet 1
            click radio button "Proxies"
            tell group 1
                //what to do here to change Web Proxy and Secure Web Proxy Checkboxes?
            end tell
        end tell
    end tell
end tell
end tell

「Web Proxy」および「Secure Web Proxy」設定の値を変更できません。アクセシビリティ インスペクターで表示されるタイトルがないためです。

上記で試したのと同様のApplescriptを使用してチェックボックスを有効/無効にする他の方法はありますか?

4

1 に答える 1

0

/usr/sbin/networksetup に「networksetup」というコマンド ライン ツールがあります。私はそれをあまり使用していませんが、そのマニュアルページを見ると、プロキシに関するいくつかのことがあります。ここに私が見るカップルがあります...

[-getwebproxy networkservice]
[-setwebproxy networkservice domain portnumber authenticated username password]
[-setwebproxystate networkservice on | off]
[-getsecurewebproxy networkservice]
[-setsecurewebproxy networkservice domain portnumber authenticated username password]
[-setsecurewebproxystate networkservice on | off]

したがって、これらを使用する「do shell script」コマンドが機能するはずです。残念ながら、特定のコマンドについてお手伝いすることはできませんが、頑張ってください。

ちなみに、manページの例では、これらを示しています...

networksetup -setwebproxy "Built-in Ethernet" proxy.company.com 80
networksetup -setwebproxy "Built-In Ethernet" proxy.company.com 80 On authusername authpassword
于 2011-09-18T10:05:33.050 に答える