Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Script To App

attraverso un tutorial sono riuscito a convertire il mio script in un app ma adesso non so come chiedere all'utente la password sudo.

Vi allego il tutorial che ho seguito:

https://www.youtube.com/watch?v=s9Rn2YktWak

Posted on Sep 20, 2021 8:36 AM

Reply
2 replies

Sep 20, 2021 1:32 PM in response to G9009

You should not directly ask the user for the sudo password. In fact, you shouldn't be using sudo at all.


I assume your AppleScript is using do shell script and you're doing something like:


do shell script "sudo command.sh -switch -otherswitch"


You should NOT do this. Instead, do shell script has an optional with administrator privileges parameter:


do shell script "command.sh -switch -otherswitch" with administrator privileges


This takes care of authenticating the user and runs the command in the correct context

Script To App

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.