Photo Booth Plist Rebuild/Repair Script

Update 2023-10-17
The script has been verified to work in macOS Sonoma.

When I switched from an older MacBook Pro to a MacBook Air the backup from my old MacBook Pro was corrupted and unmountable. However, I had preserved a backup of my Photo Booth Photos and wanted the Photo Booth application to recognize them. This is just a matter of creating a Recents.plist, an ordered list of the image files.

While adding these photos to the Recents.plist file Photo Booth uses seems straightforward enough, arranging hundreds of photos from different naming schemes across various OS versions manually is pretty tedious.

To fix this, I wrote a script that automatically creates a new plist file with the photos in the correct order. As a safety measure, the script backs up the existing Recents.plist as Recents.plist.bk.[time], allowing easy restoration if needed.

Usage

Please Note - NEW

This script is compatible with macOS versions up to macOS 14 (Sonoma). However, it relies on PHP. While PHP was bundled with macOS until macOS 12 (Monterey), subsequent versions require a separate PHP installation.

I recommend using Homebrew. You can find Homebrew installation instructions on their official website.

After setting up Homebrew, install PHP by entering the following command:

brew install php

To Begin With

Ensure all photos and movies you wanted loaded into Photo Booth are located in your Pictures/Photo Booth Library/Pictures/ folder.

Ensure the Photo Booth Application is closed to avoid overwriting our changes.

Simple Method

Added September 10, 2012
Open Terminal and run the following command.

curl -Ls https://gist.githubusercontent.com/donatj/1108691/raw/Photobooth_rebuild.sh.php | php

Git Method

Simply executing the following should both download it and set it executable.

git clone https://gist.github.com/1108691.git PhotoBoothRepair

Non-Git Method

Save the script somewhere accessible to you via Terminal.

Navigate in Terminal to the directory where you saved the shell script

Set the file executable by running
chmod +x Photobooth_rebuild.sh.php

Execute the shell script
./Photobooth_rebuild.sh.php

All Done - Fire up Photo Booth to see our results!

Known Limitations

All Leopard format names will come first regardless of date simply for lack of anything to go on. They're just numbered and contain no date information.