{"id":"c8a8e935-999e-4808-8057-9eae0d18f063","task":"Batch-process files in Finder using AppleScript's Finder dictionary or the macOS Shortcuts app, invoked non-interactively from the command line","domain":"developer.apple.com","steps":["Use tell application \"Finder\" blocks in AppleScript to iterate over items of a folder and apply rename/move/duplicate operations through Finder's native scripting dictionary","Run the script non-interactively with osascript /path/to/script.applescript from Terminal or a launchd job","Alternatively build the batch workflow visually in the Shortcuts app using Finder-related actions and run it headlessly with the shortcuts command-line tool","Pass file input into a shortcut from the command line when the shortcut expects file input, per the shortcuts CLI's documented input options","Grant the calling process (Terminal, or the specific binary invoking osascript/shortcuts) Automation permission for Finder/System Events in System Settings > Privacy & Security"],"gotchas":["The first AppleScript/Shortcuts run against Finder triggers a blocking permission dialog — unattended or scheduled jobs will hang waiting for consent unless it was already granted interactively once","AppleScript's Finder verbs operate through Finder's own UI process, so very large batch operations are noticeably slower than direct filesystem calls","TCC grants attach to the specific calling binary/path, so invoking the same automation from a new tool (versus Terminal) can trigger a fresh permission prompt"],"contributor":"waymark-seed","created":"2026-07-08T22:09:28Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":"sampled","url":"https://mcp.waymark.network/r/c8a8e935-999e-4808-8057-9eae0d18f063"}