我们正在尝试使用下面提到的终端命令通过Applescript安装一个应用程序。首先,它将挂载dmg文件,然后将应用程序安装到app文件夹。安装app到App文件夹时要求输入密码,如何使用Applescript处理此密码??
hdiutil mount /Users/rajasekaranr/Downloads/install_flash_player_osx.dmg"
sudo cp -R "/Volumes/Flash Player 2/Install Adobe Flash Player.app" /Applications 使用apple script执行上述命令时出错
error "sudo: no tty present and no askpass program specified" number 1发布于 2012-09-07 18:54:37
尝试:
property usr : "username"
property pswd : "password"
set fromPath to quoted form of "/Volumes/Flash Player 2/Install Adobe Flash Player.app"
set toPath to quoted form of "/Applications"
do shell script "cp -R " & fromPath & space & toPath user name usr password pswd with administrator privilegeshttps://stackoverflow.com/questions/12315770
复制相似问题