Tuesday, June 27, 2017

#1 2017-06-11 11:31:39 am

Schmye Bubbula
Member
Registered: 2003-11-22
Posts: 110

Way to specify text in macOS system password dialog?

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.

Offline

 

#2 2017-06-11 06:55:08 pm

Shane Stanley
Member
From: Australia
Registered: 2002-12-07
Posts: 5023

Re: Way to specify text in macOS system password dialog?

That's what the with prompt parameter is for. It requires version 10.10 or later.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

#3 2017-06-11 07:11:28 pm

Schmye Bubbula
Member
Registered: 2003-11-22
Posts: 110

Re: Way to specify text in macOS system password dialog?

^ 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?:

Applescript:

do shell script "echo xxxxxxx" with prompt "Need your Mac admin password to modify a system file" with administrator privileges

...or perhaps:

Applescript:

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)

Last edited by Schmye Bubbula (2017-06-11 07:12:23 pm)

Offline

 

#4 2017-06-11 07:14:18 pm

Shane Stanley
Member
From: Australia
Registered: 2002-12-07
Posts: 5023

Re: Way to specify text in macOS system password dialog?

The order of labeled parameters doesn't matter. And yes, you're out of luck before 10.10.


Shane Stanley <sstanley@myriad-com.com.au>
www.macosxautomation.com/applescript/apps/

Offline

 

Board footer

Powered by FluxBB

[ Generated in 0.045 seconds, 8 queries executed ]

RSS (new topics) RSS (active topics)