How can I run a shell script with admin privileges from Applescript?
Solution 1:
You can pass administrator privileges to a line of AppleScript which requires administrator privileges by appending "with administrator privileges":
do shell script "security add-trusted-cert -d -r trustRoot -k /Library/Keychains/System.keychain ~/Desktop/MyWiFiCertificate.crt" with administrator privileges