# πŸ‘€ PEEKABOO! πŸ“Έ ## 🎯 **Peekabooβ€”screenshot got you! Now you see it, now it's saved.** πŸ‘€ β†’ πŸ“Έ β†’ πŸ’Ύ β€” **Unattended screenshot automation that actually works** --- ## πŸš€ **THE MAGIC** **Peekaboo** is your silent screenshot assassin. Point it at any app, and SNAP! β€” it's captured and saved before you can blink. - 🎯 **Smart targeting**: App names or bundle IDs - πŸš€ **Auto-launch**: Sleeping apps? No problem! - πŸ‘ **Brings apps forward**: Always gets the shot - πŸ— **Creates directories**: Paths don't exist? Fixed! - 🎨 **Multi-format**: PNG, JPG, PDF β€” you name it - πŸ’₯ **Zero interaction**: 100% unattended operation --- ## πŸŽͺ **TWO FLAVORS** ### 🎯 **Peekaboo Classic** (`peekaboo.scpt`) *Simple. Fast. Reliable.* ```bash # πŸ‘€ One app, one shot osascript peekaboo.scpt "Safari" "/Users/you/Desktop/safari.png" # 🎯 Bundle ID targeting osascript peekaboo.scpt "com.apple.TextEdit" "/tmp/textedit.jpg" ``` ### πŸŽͺ **Peekaboo Pro** (`peekaboo_enhanced.scpt`) *All the power. All the windows. All the time.* ```bash # πŸ” What's running right now? osascript peekaboo_enhanced.scpt list # 🎭 Capture ALL windows with smart names osascript peekaboo_enhanced.scpt "Chrome" "/tmp/chrome.png" --multi # πŸͺŸ Just the front window osascript peekaboo_enhanced.scpt "TextEdit" "/tmp/textedit.png" --window ``` --- ## ⚑ **QUICK WINS** ### 🎯 **Basic Shot** ```bash osascript peekaboo.scpt "Finder" "/Desktop/finder.png" ``` **Result**: Full screen with Finder in focus β†’ `finder.png` ### 🎭 **Multi-Window Magic** ```bash osascript peekaboo_enhanced.scpt "Safari" "/tmp/safari.png" --multi ``` **Result**: Multiple files with smart names: - `safari_window_1_GitHub.png` - `safari_window_2_Documentation.png` - `safari_window_3_Google_Search.png` ### πŸ” **App Discovery** ```bash osascript peekaboo_enhanced.scpt list ``` **Result**: Every running app + window titles. No guessing! --- ## πŸ›  **SETUP** ### 1️⃣ **Make Executable** ```bash chmod +x peekaboo.scpt peekaboo_enhanced.scpt ``` ### 2️⃣ **Grant Powers** - System Preferences β†’ Security & Privacy β†’ **Screen Recording** - Add your terminal app to the list - ✨ You're golden! --- ## 🎨 **FORMAT PARTY** Peekaboo speaks all the languages: ```bash # PNG (default) - crisp and clean osascript peekaboo.scpt "Safari" "/tmp/shot.png" # JPG - smaller files osascript peekaboo.scpt "Safari" "/tmp/shot.jpg" # PDF - vector goodness osascript peekaboo.scpt "Safari" "/tmp/shot.pdf" ``` --- ## πŸ† **POWER MOVES** ### 🎯 **Targeting Options** ```bash # By name (easy) osascript peekaboo.scpt "Safari" "/tmp/safari.png" # By bundle ID (precise) osascript peekaboo.scpt "com.apple.Safari" "/tmp/safari.png" # By display name (works too!) osascript peekaboo.scpt "Final Cut Pro" "/tmp/finalcut.png" ``` ### πŸŽͺ **Pro Features** ```bash # Multi-window capture --multi # All windows with descriptive names # Window modes --window # Front window only (unattended!) # Debug mode --verbose # See what's happening under the hood ``` ### πŸ” **Discovery Mode** ```bash osascript peekaboo_enhanced.scpt list ``` Shows you: - πŸ“± All running apps - πŸ†” Bundle IDs - πŸͺŸ Window counts - πŸ“ Exact window titles --- ## 🎭 **REAL-WORLD SCENARIOS** ### πŸ“Š **Documentation Screenshots** ```bash # Capture your entire workflow osascript peekaboo_enhanced.scpt "Xcode" "/docs/xcode.png" --multi osascript peekaboo_enhanced.scpt "Terminal" "/docs/terminal.png" --multi osascript peekaboo_enhanced.scpt "Safari" "/docs/browser.png" --multi ``` ### πŸš€ **CI/CD Integration** ```bash # Automated testing screenshots osascript peekaboo.scpt "Your App" "/test-results/app-$(date +%s).png" ``` ### 🎬 **Content Creation** ```bash # Before/after shots osascript peekaboo.scpt "Photoshop" "/content/before.png" # ... do your work ... osascript peekaboo.scpt "Photoshop" "/content/after.png" ``` --- ## 🚨 **TROUBLESHOOTING** ### πŸ” **Permission Denied?** - Check Screen Recording permissions - Restart your terminal after granting access ### πŸ‘» **App Not Found?** ```bash # See what's actually running osascript peekaboo_enhanced.scpt list # Try the bundle ID instead osascript peekaboo.scpt "com.company.AppName" "/tmp/shot.png" ``` ### πŸ“ **File Not Created?** - Check the output directory exists (Peekaboo creates it!) - Verify disk space - Try a simple `/tmp/test.png` first ### πŸ› **Debug Mode** ```bash osascript peekaboo_enhanced.scpt "Safari" "/tmp/debug.png" --verbose ``` --- ## πŸŽͺ **COMPARISON** | Feature | Classic 🎯 | Pro πŸŽͺ | |---------|------------|--------| | Basic screenshots | βœ… | βœ… | | App targeting | βœ… | βœ… | | Multi-format | βœ… | βœ… | | **App discovery** | ❌ | βœ… | | **Multi-window** | ❌ | βœ… | | **Smart naming** | ❌ | βœ… | | **Window modes** | ❌ | βœ… | | **Verbose logging** | ❌ | βœ… | --- ## πŸ§ͺ **TESTING** We've got you covered: ```bash # Run the full test suite ./test_screenshotter.sh # Test and cleanup ./test_screenshotter.sh --cleanup ``` Tests everything: - βœ… App resolution (names + bundle IDs) - βœ… Format support (PNG, JPG, PDF) - βœ… Error handling - βœ… Directory creation - βœ… File validation - βœ… Multi-window scenarios --- ## βš™οΈ **CUSTOMIZATION** Tweak the magic in the script headers: ```applescript property captureDelay : 1.0 -- Wait before snap property windowActivationDelay : 0.5 -- Window focus time property enhancedErrorReporting : true -- Detailed errors property verboseLogging : false -- Debug output ``` --- ## πŸŽ‰ **WHY PEEKABOO ROCKS** ### πŸš€ **Unattended = Unstoppable** - No clicking, no selecting, no babysitting - Perfect for automation and CI/CD - Set it and forget it ### 🎯 **Smart Targeting** - Works with app names OR bundle IDs - Auto-launches sleeping apps - Always brings your target to the front ### 🎭 **Multi-Window Mastery** - Captures ALL windows with descriptive names - Safe filename generation - Never overwrites accidentally ### πŸ” **Discovery Built-In** - See exactly what's running - Get precise window titles - No more guessing games --- ## πŸ“š **INSPIRED BY** Built in the style of the legendary **terminator.scpt** β€” because good patterns should be celebrated and extended. --- ## πŸŽͺ **PROJECT FILES** ``` πŸ“ AppleScripts/ β”œβ”€β”€ 🎯 peekaboo.scpt # Classic version β”œβ”€β”€ πŸŽͺ peekaboo_enhanced.scpt # Pro version β”œβ”€β”€ πŸ§ͺ test_screenshotter.sh # Test suite └── πŸ“– README.md # This awesomeness ``` --- ## πŸ† **THE BOTTOM LINE** **Peekaboo** doesn't just take screenshots. It **conquers** them. πŸ‘€ Point β†’ πŸ“Έ Shoot β†’ πŸ’Ύ Save β†’ πŸŽ‰ Done! *Now you see it, now it's saved. Peekaboo!* --- *Built with ❀️ and lots of β˜• for the macOS automation community.*