Skip to content

Scripting & Automation

AppleScript & Shortcuts

6 curated resources, easiest first.

AppleScript, Do Shell. How do I write the 'test' command to the 'script editor'? — by Quinn "The Eskimo!" (Apple DTS) on Apple Developer Forums

intermediateforum

Apple's DTS engineer explains that do shell script throws an AppleScript error whenever the command exits non-zero (so test -d on a missing folder errors), shows try blocks to handle it, multi-line scripts, and quoted form of POSIX path for safe paths. He also suggests avoiding the shell where System Events can do the job.