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:
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:
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
there is a method in osascript or bash?
Script To App