set userName to short user name of (system info) do shell script "system_profiler SPHardwareDataType | grep Serial" set serial to result set ipadress to IPv4 address of (get system info) -- Create a dialog with 3 buttons display dialog "Verktygsprogram Mac - användare: " & userName buttons {"Byt lösenord", "Reparera Wi-Fi", "Reparera inloggning"} default button 1 with title "Båstads kommun - Verktygsprogram Mac v.1.0" with icon caution --Change password if result = {button returned:"Byt lösenord"} then tell application "Finder" to open file "Accounts.prefpane" of (path to system preferences) tell application "System Events" tell application process "System Preferences" delay 1 click button -1 of tab group 1 of window 1 end tell end tell --Repair Wi-Fi else if result = {button returned:"Reparera Wi-Fi"} then do shell script "networksetup -setairportpower en0 off" do shell script "sudo networksetup -removepreferredwirelessnetwork en0 BastadsKommun" with administrator privileges do shell script "networksetup -setairportpower en0 on" display dialog "Anslut nu till Wi-Fi: BastadsKommun med ditt användarkonto" buttons {"OK"} default button 1 with icon stop --Reparera inloggning else if result = {button returned:"Reparera inloggning"} then display dialog "Reparerar inloggning... OBS! Din dator kommer att startas om." buttons {"OK"} default button 1 with icon stop delay 3 do shell script "rm -R /Users/$3/Library/Keychains" with administrator privileges tell application "System Events" restart end tell else display dialog "Båstads kommun" buttons {"OK"} default button 1 with icon note end if |