Operate the automation

Finish the automation runbook

Test normal, duplicate, missing-input, permission, and interruption paths, then document installation, verification, pause, and removal.

10 minute lesson

~~~

Build one final automation from this course: accept selected screenshots, create safe project copies, and run either from Finder or a LaunchAgent. Every module contributed a piece — the task card, the contract, the shortcut trigger, the script, the plist, the lock, the log line. What remains is proving the whole thing and writing it down.

Test the paths that will really happen

Test valid input, duplicates, spaces, missing files, denied permission, two simultaneous runs, and interruption before the final move. Each of those replays a lesson from this course against the finished automation, and each has a defined correct answer if you wrote the contract: duplicates skip, denied permission fails loudly, an interrupted run leaves no partial file behind.

Preserve fixtures and expected results:

fixtures/
  one-file/    sample.png           -> expect: 1 copy created
  duplicate/   sample.png, run x2   -> expect: "already processed"
  spaces/      Screen Shot 3.png    -> expect: 1 copy, name intact
  wrong-type/  notes.txt            -> expect: rejected at input

Kept fixtures turn “I tested it once in August” into a suite you rerun after every macOS update and every edit to the script.

Write the runbook

Document prerequisites, permissions, configuration, logs, dry run, manual invocation, scheduled invocation, disablement, removal, and recovery. In practice that is one short line or section each:

permissions: Terminal -> Automation -> Finder (approved 2026-08-03)
logs:        ~/Library/Logs/screenshot-sorter.log
dry run:     ~/bin/sort-screenshots --dry-run
manual run:  ~/bin/sort-screenshots
disable:     launchctl bootout gui/$UID/com.flaviocopes.screenshot-sorter
recovery:    remove ~/.local/state/screenshot-sorter.lock if the pid is dead

The measure of done: another person should be able to stop it safely. Not use it — stop it, at two in the morning, without calling you. If the disable line works when pasted by someone who has never seen the project, the runbook is real.

Verify the runbook the way you verified the code: follow it literally, on a clean user account or after a reboot. Every step you perform from memory instead of from the page is a step missing from the page.

Lesson completed

Take this course offline

Get every free book and course as PDF and EPUB files.

Get the download library →