https://www.jianshu.com/p/a22084e87b09
https://sspai.com/post/46912
AppleScript使用sudo权限执行命令
// 终端执行操作(当前用户权限)
do shell script "SOME COMMANDS"
// 终端执行操作(sudo权限)
do shell script "SOME COMMANDS" with administrator privileges
// 错误格式命令
// do shell script "sudo SOME COMMANDS"
// 报错:
// AppleScript 错误
// sudo: no tty present and no askpass program specified
网友评论