Problem with automator folder action changing file ownership

I've written an automator script that accepts a file from a folder action and changes ownership of that file. (My printer sends scans to my Mac that are owned by root). I have a shell script that works fine in terminal, but won't work in the automator workflow. Attached is the workflow as well as the error message. The workflow doesn't seem to have an error, but it doesn't work either!

iMac 24″, macOS 11.4

Posted on Jul 13, 2021 3:52 PM

Reply
Question marked as Top-ranking reply

Posted on Jul 13, 2021 6:08 PM

@Barney-15E: Solved it! "Pass input" was set to stdin. I was looking at the shell script and realized that it was expecting arguments. Changed that parameter and works great. Thanks for making me look at it deeper.

Similar questions

4 replies

Jul 13, 2021 4:33 PM in response to wa1oui

You don't need the "Get selected Finder items" action as the file is passed from the Folder Action. However, that is not the problem.

The problem is under Big Sur, processes must ask your permission to access your files. When you run it from Automator, it is running as your users. When it runs automatically, it is not. I don't know what process runs the action, but you would need to give it Full Disk Access in the Privacy & Security System Preferences.

Try FolderActionsDispatcher in the /System/Library/CoreServices folder.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Problem with automator folder action changing file ownership

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