This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell current application | |
activate | |
do shell script "killall coreaudiod" with administrator privileges | |
end tell |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tell application "System Preferences" | |
activate | |
set current pane to pane "com.apple.preference.keyboard" | |
end tell | |
tell application "System Events" | |
-- If we don't have UI Elements enabled, then nothing is really going to work. | |
if UI elements enabled then | |
tell application process "System Preferences" | |
get properties |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- This does not work if you need administrator privilieges for setting Wi-Fi power | |
set correctcountrycode to "DE" | |
repeat 10 times | |
set countrycode to do shell script "system_profiler SPAirPortDataType -xml | xmllint --dropdtd - | xpath '//key[text()=\"spairport_wireless_country_code\"]/following-sibling::string[1]/text()'" | |
if countrycode = correctcountrycode then exit repeat | |
do shell script "networksetup -setairportpower en1 off" | |
delay 6 | |
do shell script "networksetup -setairportpower en1 on" | |
delay 2 | |
end repeat |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
ifconfig lo0 alias $1 |