#Apple folks, what is the best way to monitor a folder under #macOS and invoke a shell script/command when new files are added?

I want to have a PDF-inbox, which gets OCRt whenever I add a new file. Currently my NAS does this via cronjob and I need a better solution.

#Automator ? #FSWatch ?

@dalcacer I suggest to look for "folder actions" for this purpose. They can trigger AppleScripts or Automator actions.

Since #macos #tahoe folder actions can also trigger shortcuts, like described here: https://sixcolors.com/post/2025/08/get-started-with-folder-automation-in-macos-tahoe/

Get started with folder automation in macOS Tahoe

Setting up a folder Automation in macOS Tahoe. One of the most exciting additions in macOS Tahoe is Shortcuts automation, which (among many other things) allows Shortcuts to act when things move or…

Six Colors

@maddin tried something in that direction, and wasn't really getting the hangs of it.

Maybe that article will guide me in the right direction. Thanks!