I use numerous scripts that open folders, copy files, delete files etc. Some work like always…now some are asking for Mac HD PW which kills the purpose of the script to do something, like it did for the past 20 years, NOW…some scripts keep asking me for a PW to execute some commands.
Without seeing your script it’s almost impossible to answer…
‘some scripts’… asking for a password to execute ‘some commands’…
Yup, I can tell you exactly how long a piece of string is.
You don’t even tell us which app you’re targeting. Is this a Finder script, since you’re dealing with copying files and folders? or are you doing this via shell commands? What’s common about the (unknown) commands that do trigger a password request vs. those that don’t?
When using sudo, if the command itself fails (for example, due to an error before execution), the sudo timestamp is not refreshed.
As a result, you’ll be prompted for the password every time.
That might be what’s happening here.
repeat with itemNo from 1 to 3 by 1
try
set strCmd to ("/usr/bin/sudo /bin/mkdir -p \"/tmp/SOME" & itemNo & "\" | /SOME/MistakeCommandLine") as text
do shell script strCmd
end try
end repeat