Hi,
Continuing the discussion from Problem with do shell script and chflags command - I am under the impression that there is a major bug:
Try this (I am sorry but I can offer only a script template - and be assured that I checked and double checked folder and bundle permissions, as well as user name and password on two (Intel-)Macs and the mentioned OSes and that I am aware of the dangers of rm -rf) replacing XXX.app by any application bundle (could be any file though) at the given location:
The following does not work - “operation not permitted”:
do shell script "rm -rf '/Users/[myAccount]/Downloads/XXX.app'" with administrator privileges
-- same with hardcoded username and PW
This one, however, does without a hitch:
do shell script "rm -rf '/Users/[myAccount]/Downloads/XXX.app'"
Both of the following spectacularly work, too:
do shell script "rm -rf '/Applications/XXX.app'" with administrator privileges
and
do shell script "rm -rf '/Applications/XXX.app'"
I can run
rm -rf '/Users/[myAccount]/Downloads/XXX.app'"
or
sudo rm -rf '/Users/[myAccount]/Downloads/XXX.app'"
in a terminal and both work.
I can select the app in the Finder and press cmd-backspace and it gets moved to the trash etc. etc.
I experimented with a slew of TCC privileges like full disk acces, application administration etc. etc., some of them or certain combinations of them making FastScript, or Script Debugger crash or the applet bringing up incomprehensible and unrelated error messages (about a window in a previous launch I tried to open and if I’d like to try again). I exported the script as a read-only bundle from ScriptDebugger. To no avail.
So something seems to be fundamentally wrong here, or I am doing something fundamentally wrong.
I’d appreciate any pointers. Thank you!