In a do shell script… with administrator privileges, is there a way in AppleScript (or with shell scripting) to control the text in the standard macOS system password entry dialog? I want to state the reason the user’s password is being asked, and wish to avoid an inelegant two dialogs in a row.
That’s what the with prompt parameter is for. It requires version 10.10 or later.
^ Since I’m in macOS 10.6.8 Snow Leopard, I guess you’re saying that I’m out of luck. (Unless there’s some other way.)
Nevertheless, would the syntax in macOS 10.10+ look something like this?:
do shell script "echo xxxxxxx" with prompt "Need your Mac admin password to modify a system file" with administrator privileges
…or perhaps:
do shell script "echo xxxxxxx" with administrator privileges with prompt "Need your Mac admin password to modify a system file"
AppleScript: 2.1.2
Operating System: Mac OS X (10.6.8)
The order of labeled parameters doesn’t matter. And yes, you’re out of luck before 10.10.