Space Cat, Prince Among Thieves

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.

Comment by: Mark on

Mark's Gravatar Can you explain us with print screens or something? I don't understand the steps. I know where is "terminal" and simple details but i don't understand whats i have to type to terminal.

Comment by: Jesse G. Donat on

Jesse G. Donat's Gravatar While I do think it’s pretty self-explanatory, I have though for your sake changed the visual style of the Terminal commands to be more obvious – I hope that helps.

This guide looks pretty useful for getting you up to speed on basic Terminal usage, I hope it helps.

Comment by: Federico on

Federico's Gravatar I LOVE YOU!!!!! You're a genius!

Comment by: Jon Zantua on

Jon Zantua's Gravatar I can't understand terminal please help me with screen shots please? Having problems with photobooth :>

Comment by: ZorkFox on

ZorkFox's Gravatar Genius. Thank you, sir!

Comment by: Kris on

Kris's Gravatar Great work, retrieved my 13 year old daughter's Photo Booth library dating back to 2006 :) All the best from Kris, Melbourne, Australia.

Comment by: Scott Kennedy on

Scott Kennedy's Gravatar Just wanted to say thanks for this. I am a complete novice and manage to follow these instructions. You legend!!!

Comment by: Logan on

Logan's Gravatar When I attempt to navigate to the script (saved as a .txt) in terminal I get the message "Permission denied"...I am the only account on my macbook and the admin. What am I doing wrong?

Comment by: Austin on

Austin's Gravatar I saved it to my home directory so I wouldn't have to bother navigating to it, I changed the path, but it still didn't seem to work, and I don't understand enough coding to know what the error is:

AWMBP:~ austinwismer$ chmod +x Photobooth_rebuild.sh.php
AWMBP:~ austinwismer$ ./Photobooth_rebuild.sh.php
-bash: ./Photobooth_rebuild.sh.php: /usr/bin/php: bad interpreter: Operation not permitted

Comment by: FC on

FC's Gravatar Thanks, it worked for me when I upgraded from snow leopard to mountain lion this summer! I'm glad all my photos are "in" photobooth again. Cheers!

Comment by: Pierre Wygant on

Pierre Wygant's Gravatar Wish this wold work for Snow Leopard. The silly folder is called "Photo Booth" and not "Photo Booth Library'

//Cheers

Comment by: Kelso on

Kelso's Gravatar Worked wonderfully!! Yeeyuh! :')

Comment by: fats on

fats's Gravatar thank you SO MUCH -- an immediate fix

Email address will never be publicly visible.

Basic HTML allowed.