Space Cat, Prince Among Thieves

Photo Booth Plist Rebuild/Repair Script

Update 2026-09-21 The script has been updated and verified to work with macOS 27 (Golden Gate).

Note for Apple Silicon Macs: I've found that the ~/Pictures/Photo Booth Library directory can only be modified through Apple's built-in Terminal.app. Alternative terminal applications such as Ghostty and iTerm appear unable to modify its contents, for reasons I have yet to determine.

You may also need to enable Developer Mode in Terminal.app to execute the script. See my guide on running unsigned binaries in macOS Terminal for instructions.


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

PHP Requirement

This script is compatible with macOS versions through macOS 27 (Golden Gate).

The script requires PHP, which is no longer bundled with macOS. If you do not already have PHP installed, you will need to install it separately.

I recommend using Homebrew to install PHP.

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

brew install php

To Begin With

  • Ensure all photos and movies you want 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.
  • On Apple Silicon Macs, use Apple's built-in Terminal.app rather than Ghostty or iTerm if you encounter permission issues.

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

Clone the repository, then execute the script using PHP.

git clone https://gist.github.com/1108691.git PhotoBoothRepair
cd PhotoBoothRepair
php Photobooth_rebuild.sh.php

Non-Git Method

  • Save the script somewhere accessible to you via Terminal.

  • Navigate in Terminal to the directory where you saved the script.

  • Set the file executable by running:

    chmod +x Photobooth_rebuild.sh.php
  • Execute the script:

    ./Photobooth_rebuild.sh.php
  • All done! Fire up Photo Booth to see the 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

Comment by: Savagedisguilt on

Savagedisguilt's Gravatar Hi! Is there any way to sort them? Thanks.

Comment by: Jesse G. Donat on

Jesse G. Donat's Gravatar If you were seeing sorting issues, it should now sort correctly by date, oldest to newest.

I had to update the script a bit. Apple apparently made a tiny change to the filename format in macOS Tahoe, replacing the regular space between the time and AM/PM with a non-breaking space. That was enough to break my existing sorting logic. 🙄

The script has been updated to handle both formats. I've also added some notes about Apple Silicon near the top of the article, so be sure to read those!

Email address will never be publicly visible.

Basic HTML allowed.