Skip to main content
Paul Welty, PhD AI, WORK, AND STAYING HUMAN

On a Mac, how do i programatically compress each folder in a folder?

Easily automate folder compression on your Mac using AppleScript to save time and declutter your storage efficiently.

As part of cleaning out some old drive storage, I needed to zip a folder of folders. I could, of course, do this by hand, but it was a lot of folders and would be rather tedious. Instead of doing that for 10 minutes, I took 2 hours to figure out an automated solution!

I tried Forklift, Automator, Shortcuts, and Pathfinder. Nothing could do it; at least I couldn’t find a way to do it. After some searching, I found partial solutions in AppleScript. Here’s what I came up that solved my problem.

tell application “Finder"	set theFolders to selection	repeat with aFolder in theFolders		set theItem to aFolder as alias
		set itemPath to quoted form of POSIX path of theItem
		set fileName to name of theItem
		set theFolder to POSIX path of (container of theItem as alias)
		set zipFile to quoted form of (fileName & ".zip")
		do shell script "(cd " & quoted form of theFolder & " && zip -r " & zipFile & " " & quoted form of fileName & ")"	
	end repeat
end tell

A key feature of this solution is that it doesn’t create an archive with the full pathname. The zip file contains only the folder name and “down”.

Why customer tools are organized wrong

This article reveals a fundamental flaw in how customer support tools are designed—organizing by interaction type instead of by customer—and explains why this fragmentation wastes time and obscures the full picture you need to help users effectively.

Infrastructure shapes thought

The tools you build determine what kinds of thinking become possible. On infrastructure, friction, and building deliberately for thought rather than just throughput.

Server-side dashboard architecture: Why moving data fetching off the browser changes everything

How choosing server-side rendering solved security, CORS, and credential management problems I didn't know I had.

The work of being available now

A book on AI, judgment, and staying human at work.

The practice of work in progress

Practical essays on how work actually gets done.

Manual fluency is the prerequisite for agent supervision

You cannot responsibly automate what you cannot do manually. AI agents speed up work for people who already know how to do it. They do not replace the need to learn the work in the first place.

The gun you didn't need

Every organization has loaded weapons lying around that nobody remembers loading. The most dangerous capability in any system is the one you built 'just in case.'

Nobody promotes you to operator

There's a moment in every project where the work stops being about building and starts being about keeping things running. Nobody announces this transition. Nobody gives you new tools for it. And most people keep building long past the point where they should have stopped.