You’re getting a little confused between your terminal scripting, ‘do shell script’ and sudo.
None of the commands in your example (except for the activate) actually targets terminal.app.
‘do shell script’ is the built-in standard command for executing shell commands. It doesn’t require (or even use) terminal.app but runs the command directly.
If you want to use terminal.app you should use the ‘do script’ command instead (but you shouldn’t need to use terminal.app in this instance).
So, given that you’re using ‘do shell script’, you can eschew all the ‘sudo’ because it’s irrelevant. ‘with administrator privileges’ takes care of the authentication and elevated privileges.
So your script should look more like:
do shell script "my commande line in terminal" password adminPass with administrator privileges
This Script is made for deleting specific files in the system/library
I need to be able to run this script on Mac who have Multiple Users (at work) (on every user type, Admin or not)
On the Admin user, it works fine, but on other standard users (non administrator’s privilege), the script doesn’t work. I think it doesn’t recognize the admin password.
And…
If i tried to run the command line with Terminal
(do script “rm -f /System/Library/Caches/xxxxx” password adminPass with administrator privileges) the Terminal doesn’t recognize the admin password ? And this with or without an Admin User interface??