Published: March 27, 2026 | Reading time: 15 min
macOS is built for automation. From simple keyboard shortcuts to complex workflows connecting dozens of apps, automation can save hours of repetitive work. This guide covers the complete automation toolkit available on your Macβfrom beginner-friendly Shortcuts to powerful AppleScript and shell scripting.
| Tool | Difficulty | Best For |
|---|---|---|
| Shortcuts | Beginner | No-code automation, app integration |
| Automator | Beginner-Intermediate | Visual workflow builder |
| AppleScript | Intermediate | Deep app control, logic |
| Shell Scripting | Intermediate-Advanced | System tasks, file processing |
| Python/Perl | Advanced | Complex processing, API integration |
Shortcuts (formerly Workflow) is Apple's visual automation app, perfect for connecting apps and automating repetitive tasks.
Shortcuts comes pre-installed on macOS Monterey and later. Find it in Applications or use Spotlight.
# Example: Image Optimization Shortcut
# 1. New Shortcut β Name: "Optimize Images"
# 2. Add actions:
# - "Get Selected Files" (from Finder)
# - "Resize Image" (Width: 1200, maintain aspect)
# - "Compress Images" (Quality: medium)
# - "Save Images" (to Desktop/Optimized)
# 3. Assign keyboard shortcut: Cmd+Shift+O
# Example: Daily Screenshot Organizer
# 1. Watch Folders for ~/Desktop/Screenshots
# 2. Move to ~/Pictures/Screenshots/YYYY-MM-DD/
# 3. Open folder in Finder
Automator has been a Mac staple for years, offering visual workflow building with hundreds of actions.
# Automator Workflow Steps:
# 1. File β New β Workflow
# 2. Add actions:
# - "Ask for Finder Items" (specify image types)
# - "Scale Images" (by percentage or size)
# - "Copy Finder Items" (to output folder)
# - "Open Finder Items" (preview results)
# 3. Save as Application
# Now drag any image onto the app to resize!
# Folder Action Setup:
# 1. Right-click on ~/Downloads β Folder Actions Setup
# 2. Attach workflow: "Compress items in folder"
# 3. Files added to Downloads auto-compress
# 4. Saves space and keeps Downloads organized
AppleScript is Apple's scripting language designed to control applications and automate complex workflows.
# Basic AppleScript syntax
tell application "Finder"
activate
make new Finder window
set target of front window to path to documents folder
end tell
# Getting user input
display dialog "Enter your name:" default answer ""
set userName to text returned of result
display notification "Hello, " & userName
# Working with files
tell application "Finder"
set selectedItems to selection
repeat with itemRef in selectedItems
-- Process each selected file
end repeat
end tell
-- Batch Rename Script
tell application "Finder"
set sourceFolder to folder "Macintosh HD:Users:username:Documents:ToRename:"
set fileList to every file of sourceFolder
repeat with aFile in fileList
set originalName to name of aFile
set newName to "Processed_" & originalName
set name of aFile to newName
end repeat
display notification "Renamed " & (count fileList) & " files"
end tell
-- Simple Backup to External Drive
tell application "Finder"
set sourceFolder to folder "Macintosh HD:Users:username:Documents:"
set backupFolder to folder "Backup:Documents Backup:"
-- Use shell for robust copy
do shell script "rsync -av --delete " & POSIX path of sourceFolder & " " & POSIX path of backupFolder
display notification "Backup completed!"
end tell
Shell scripting (bash, zsh) provides powerful system-level automation for Mac.
#!/bin/zsh
# macOS-specific commands
# Open apps and files
open -a "Safari"
open "~/Documents/report.pdf"
# Use macOS utilities
mdfind "kind:pdf modified:>today" # Spotlight search
mdls document.pdf # Show file metadata
# Notification
osascript -e 'display notification "Backup complete" with title "Mac Automation"'
#!/bin/zsh
# daily-cleanup.sh
# Clean Downloads of files older than 30 days
find ~/Downloads -type f -mtime +30 -empty -delete
find ~/Downloads -type f -mtime +90 -delete
# Organize Desktop
mkdir -p ~/Desktop/ToProcess
find ~/Desktop -maxdepth 1 -name "*.txt" -exec mv {} ~/Desktop/ToProcess/ \;
# Empty trash securely
rm -rf ~/.Trash/*
echo "Daily cleanup complete" | osascript -e 'display notification'
# Create ~/Library/LaunchAgents/com.user.daily-cleanup.plist
Label
com.user.daily-cleanup
ProgramArguments
/bin/zsh
/Users/username/scripts/daily-cleanup.sh
StartCalendarInterval
Hour
9
Minute
0
# Load the job
launchctl load ~/Library/LaunchAgents/com.user.daily-cleanup.plist
Homebrew extends your Mac's command-line toolkit with thousands of utilities.
# Install popular automation tools
brew install wget curl jq yq fzf ripgrep fd bat
# File synchronization
brew install rsync
# Image processing
brew install imagemagick
brew install ghostscript # PDF tools
# Video processing
brew install ffmpeg
# JSON processing
brew install jq
echo '{"name":"test"}' | jq '.name'
| Task | Best Tool |
|---|---|
| Simple app automation | Shortcuts |
| File processing workflows | Automator |
| Complex app logic | AppleScript |
| System maintenance | Shell Scripts |
| Scheduled tasks | launchd |
This guide contains affiliate links. If you purchase through links, I may earn a commission at no extra cost to you.