Transparent Compression with Folder Actions in macOS
The article explains how to set up automated, transparent compression of files on macOS using Folder Actions. By attaching a script to a folder, any file added to it is automatically compressed (e.g., with gzip), making the process seamless and requiring no manual intervention.
Background
- The article describes a technique for automatically compressing files on macOS when they are added to a specific folder, using built-in tools (Folder Actions and the command-line "compress" tool). It demonstrates how to set up a folder that transparently compresses new files without user intervention.
- Folder Actions are a macOS automation feature (available since Mac OS X 10.4 Tiger) that lets users attach AppleScripts to folders; the scripts run automatically when items are added, removed, or changed in that folder.
- "Compression" here refers to lossless data compression (e.g., ZIP), which reduces file size but requires decompression before use. The post's approach is meant to save disk space for files placed into a designated "inbox" folder.
- The author, Gingerbeardman, is an indie developer and writer known for macOS tips, retro computing, and command-line productivity tools. The post is written for users comfortable with Terminal, AppleScript, and basic system administration.