u/AlmostSurely1001

Operation not permitted for some but not all shell scripts

Operation not permitted for some but not all shell scripts

I have two shortcuts that both run a shell script: one toggles between showing and hiding hidden files in Finder and another one writes the file directory of an external hard drive into a txt file.

Both run smoothly within the Shortcuts app. However, if I invoke them from Spotlight, the first one runs successfully but the second one (that one that writes the file directory of an external HD into a txt file) fails. It says "operation not permitted". I have given full disk access to the Finder app in Settings. I have searched in Google but none of the solutions provided works for me. Anyone knows how to make it work? Thanks!

https://preview.redd.it/bm34qy5l9gug1.png?width=1036&format=png&auto=webp&s=492214922771c6be613396a96c149d7b955ad9ca

https://preview.redd.it/1qd6sssl9gug1.png?width=1032&format=png&auto=webp&s=3aa6fad7587d7b0d2a1c000914629e9e785fe9e7

reddit.com
u/AlmostSurely1001 — 14 hours ago