You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Shortcuts Shell Script cannot access User's folders when execute via Quick Action

As mentioned in the title, macOS' Shortcuts' Shell Script fails to access the user's folders (e.g. Downloads, Desktop, Documents, etc.) on any commands (e.g. ls, md5) when executed via Quick Action (i.e. right click on any file in the Finder, then select "Quick Action" to run the shortcut in the menu).


I found this problem after I updated to macOS 14. I have a script that may access those folders, it worked fine on macOS 13, but cannot run properly on macOS 14 (only if the shell command accesses the user's folders).


Here below is the simplest shortcut script that can reproduce the problem.

This script can run properly if we run it directly from the Shortcuts app. But if we run it via Quick Action (as checked on the rightmost column), it will produce the following error message:

Run Shell Script finished with an error.
ls: /Users/gordon/Desktop: Operation not permitted


I have tried to check the "Privacy & Security" setting, and grant "Full Disk Access" to the Shortcuts app. But the problem still exists.

I have also tried to add 'sudo' before the command', or try some other shells other than zsh. But it still doesn't work.

MacBook Pro 14″, macOS 14.0

Posted on Oct 1, 2023 8:26 AM

Reply
4 replies

Shortcuts Shell Script cannot access User's folders when execute via Quick Action

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.