Spage Cat, Prince Among Thieves RSS Feed

Mac OSX Lion Photo Booth Plist Rebuild/Repair Script

I recently upgraded from an aging MacBook Pro to a much more nubile MacBook Air. I am frankly delighted with the Air in every way. The problem I encountered though is the sparse image backup of the MacBook Pro I made with Carbon Copy Cloner before I wiped the drive and sold it is seemingly corrupted and will not mount.

I did though have a backup of my Photo Booth Photos and wanted to get them to be recognized by the application. It is admittedly simply a matter of entering them into the Recents.plist file, but having several hundred photos across three operating systems and three naming schemes (was that *really* necessary, Apple?) getting these into the proper order by hand would have been a nuisance to say the least.

Alas! A use for my PHP skills! I went ahead and wrote a simple PHP based shell script you can use to create a new .plist file with your images properly ordered.

This will back up your current Recents.plist as Recents.plist.bk.[time] so if you decide to roll it back, it will be there for you

Basic Operation

Familiar with Git?

Simply executing

git clone git://gist.github.com/1108691.git PhotoBoothRepair
should both download it and set it executable.

Not Familiar with Git?

  • Ensure that all the Photos / Movies you want loaded into Photo Booth are located in
    ~/Pictures/Photo Booth Library/Pictures/
  • Ensure Photo Booth is closed to avoid overwriting our changes
  • Save the file below somewhere accessible to you via Terminal.
  • Correct the noted path at the top of the file to reflect your home folder
  • 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!

I welcome any and all feedback. Feel free to fork this code on Github - I'm open to any updates.

Limitations

  • It presumes all Leopard format names are pre Snow Leopard and Lion simply for lack of anything to go on (They're just numbered)

Well let me know in the comments if you find this useful. I wrote it for my personal use and it saved me a ton of time.


Comment by: James on

James Gravatarthanks, the script worked perfectly for me on Lion :)

Comment by: B on

B GravatarLikewise - only 30-odd of over 200 photo were showing up in my Photo Booth after upgrading to Lion. This script fixed it perfectly. Great stuff!! :)

Comment by: Shark on

Shark GravatarSorry I'm a total novice. Really need to repair but not sure I understand your explanation of what to do. Please could you guide me through it in a little more detail. Thanks!

Comment by: Jesse G. Donat on

Jesse G. Donat Gravatar@Shark - Its going to require at minimum a very basic level of Terminal usage - so if you're not comfortable with that this may not be for you.

That said there are basically 4 steps.
- Download the script from here.
- Correct the Photo Booth library path per your OS X user - eg: /Users/shark/Pictures/Photo Booth Library/
- In Terminal, navigate to the file and set it executable with chmod per the instructions above.
- Run the Script via Terminal

I hope this helps - if not reply including your email address in the Email field of the comment box and I'll help you via email.

Comment by: Mark on

Mark GravatarCan 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 GravatarWhile 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 GravatarI LOVE YOU!!!!! You're a genius!

Comment by: Anon on

Anon GravatarAwesome. Thank you. Running Lion. It works.

Comment by: Jon Zantua on

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

Comment by: Jim on

Jim GravatarAwesome! Thank you!

Comment by: Kris on

Kris GravatarGreat 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 GravatarJust wanted to say thanks for this. I am a complete novice and manage to follow these instructions. You legend!!!

Comment by: Logan on

Logan GravatarWhen 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?