A Python-based solution for batch converting Apple Pages documents to Microsoft Word format on macOS, with special optimizations for macOS Sequoia (15.x) compatibility issues.
This project provides a stable alternative to Automator-based conversions, which have significant reliability issues on macOS Sequoia. The converter handles large batches efficiently with automatic memory management and comprehensive error handling.
- ✅ Batch conversion of Pages to Word documents
- ✅ Smart duplicate detection (won't re-convert files)
- ✅ Automatic memory management (prevents crashes)
- ✅ Filename validation and automatic fixing
- ✅ Preserves folder structure
- ✅ Detailed logging
- ✅ Progress tracking
- macOS: Any version (optimized for Sequoia 15.x issues)
- Python: 3.6+ (included with macOS)
- Pages: Must be installed in /Applications
- Disk Space: 2x the size of your Pages documents
- RAM: 8GB minimum recommended
-
Create project folder on Desktop:
mkdir ~/Desktop/PagesConverter cd ~/Desktop/PagesConverter
-
Save all Python scripts to this folder:
pages_converter.py- Main convertercheck_filenames.py- Filename validatorfix_filenames.py- Batch filename fixerpermission_checker.py- System permission checkermenu_launcher.py- Interactive menu interfacecreate_test_documents.py- Test file generator
-
Make scripts executable:
chmod +x *.py
CRITICAL: Configure these settings before first use:
-
Full Disk Access:
- System Settings → Privacy & Security → Full Disk Access
- Add: Terminal.app
- Add: Visual Studio Code.app (if using)
-
Automation Permissions (will appear after first run):
- System Settings → Privacy & Security → Automation
- Enable all permissions for Terminal
-
Screen Lock (temporary during conversion):
- System Settings → Lock Screen
- Set all options to "Never"
- Remember to restore after conversion!
# Check system permissions first
python3 permission_checker.py
# Use the menu interface (easiest)
python3 menu_launcher.pypython3 menu_launcher.pyMenu options:
- Check System Permissions
- Create Test Documents
- Convert Pages to Word
- View Latest Log
- Quick Setup Guide
- Emergency Kill Pages
python3 check_filenames.py /path/to/folder# Preview changes (dry run)
python3 fix_filenames.py /path/to/folder
# Actually fix filenames
python3 fix_filenames.py /path/to/folder --fix# Interactive mode (will ask for folder)
python3 pages_converter.py
# Direct mode
python3 pages_converter.py /path/to/folderFor best results, follow this sequence:
# 1. Check permissions (first time only)
python3 permission_checker.py
# 2. Check for filename issues
python3 check_filenames.py ~/Desktop/YourFolder
# 3. Fix any issues found
python3 fix_filenames.py ~/Desktop/YourFolder --fix
# 4. Run the converter
python3 pages_converter.py ~/Desktop/YourFolderBefore conversion:
YourFolder/
├── Document1.pages
├── Document2.pages
└── Subfolder/
└── Document3.pages
After conversion:
YourFolder/
├── Document1.docx # New Word file
├── Document2.docx # New Word file
├── pages/ # New folder for originals
│ ├── Document1.pages # Original moved here
│ └── Document2.pages # Original moved here
└── Subfolder/
├── Document3.docx # New Word file
└── pages/ # New folder for originals
└── Document3.pages
Solution: Re-add Terminal to Full Disk Access in System Settings
Solution:
- Ensure screen is unlocked
- Disable screen sleep during conversion
- Check Activity Monitor for Pages memory usage
Problem characters:
- Backslash
\ - Colon
: - Trailing spaces before
.pages - Double spaces
- Tab characters
Solution: Run fix_filenames.py before converting
Solution:
- Check if .docx files are hidden
- Look in 'pages' subfolders
- Check the log file on Desktop
# Create a simple loop
for folder in ~/Documents/*/; do
echo "Processing $folder"
python3 check_filenames.py "$folder"
python3 fix_filenames.py "$folder" --fix
python3 pages_converter.py "$folder"
doneEdit pages_converter.py line ~19:
self.batch_size = 5 # Reduce to 3 for low memory systemsAdd after line ~47 in pages_converter.py:
# Skip files larger than 50MB
pages_files = [f for f in pages_files if f.stat().st_size < 50_000_000]- Close other applications to free memory
- Connect to power (don't run on battery)
- Process in batches of 100-200 files
- Monitor Activity Monitor for Pages memory usage
- Keep screen unlocked during conversion
Log files are saved to Desktop with timestamp:
# View latest log
ls -la ~/Desktop/pages_conversion_*.log
cat ~/Desktop/pages_conversion_*.log | tail -50killall Pages# In a separate Terminal window
caffeinate -d
# Press Ctrl+C when doneConverting a folder with 121 documents:
# 1. Check filenames
python3 check_filenames.py ~/Desktop/Form65s
# Found 23 files with issues
# 2. Fix the issues
python3 fix_filenames.py ~/Desktop/Form65s --fix
# Fixed 24 files (handles duplicates)
# 3. Convert
python3 pages_converter.py ~/Desktop/Form65s
# Converted 120/121 successfully in 8.5 minutesYou'll know it's working when you see:
- Progress bar moving in terminal
- Green checkmarks (✓) for each file
- New .docx files appearing
- 'pages' folders being created
- Log file on Desktop with details
- Don't run on your entire Documents folder at once
- Don't let the screen lock during conversion
- Don't use filenames with backslashes or colons
- Don't run multiple conversions simultaneously
- Don't delete log files until you've verified all conversions
Re-run permission checker:
python3 permission_checker.py# List all logs
ls -la ~/Desktop/pages_conversion_*.log
# Delete logs older than 30 days
find ~/Desktop -name "pages_conversion_*.log" -mtime +30 -deleteThis project is provided as-is for personal use. Feel free to modify for your needs.
Created as a workaround for Automator reliability issues in macOS Sequoia (15.x). Special thanks to the Python and AppleScript communities.
Remember: Always backup your important documents before bulk conversions!