Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Reuniting iPhoto libraries not on cd?' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Reuniting iPhoto libraries not on cd?
Authored by: vzv55p on Feb 04, '04 06:08:22AM

How would I re-unite 3 or 4 different libraries that aren't on cd?

I used iPhoto Library Manager and had about 4 diff. library directories. Any suggestion on how to get these all back together?



[ Reply to This | # ]
Reuniting iPhoto libraries not on cd?
Authored by: jaysoffian on Feb 04, '04 07:40:46PM

I'm somewhat hesitant to post this since it's a partial solution, but it worked for me. Use script editor to compile the following Applescript and then save it as an application bundle. Start up iPhoto4 then double-click this applet to run it.

The applet assumes you have already imported all your photos from your multiple iPhoto2 libraries. That's the part of this solution that's not complete - for me importing the photos was easy because I've always archived my photos (into a folder by day) *before* importing into iPhoto. So I simply needed to recreate my albums in iPhoto4 once I had re-imported all my photos from their original archive location.

Anyway, you run this applet and then point it at your existing iPhoto2 libraries (if you have multiple iPhoto2 libraries, you may want to put them all inside a single top-level folder first and then point this applet at the top-level folder, that way it can scan all the libraries at once). This applet will then recreate all the albums it finds in your existing iPhoto2 libraries inside of your iPhoto4 library. Note that all this does is recreate your albums. Any other information inside your iPhoto2 library is *NOT* carried over.

I hope this is helpful - maybe it can serve as a starting point for someone to work on a more complete solution.


on run
	importAlbumsFromLibrary(choose folder with prompt "Choose an iPhoto Library to import:")
end run

on open what
	global shouldQuit
	set shouldQuit to false
	set theLibraries to {}
	tell application "Finder"
		repeat with f in what
			if kind of f is "folder" then set theLibraries to theLibraries & f
		end repeat
	end tell
	repeat with theLibrary in theLibraries
		importAlbumsFromLibrary(theLibrary)
		if shouldQuit then exit repeat
	end repeat
end open

on importAlbumsFromLibrary(theLibrary)
	global tempFile
	global shouldQuit
	set shouldQuit to false
	set theLibrary to quoted form of POSIX path of theLibrary
	set tempFile to do shell script "/usr/bin/mktemp -t /tmp"
	try
		set theScript to "find " & theLibrary & " -type l -path '*/Albums/*' | sed 's/.*\\/Albums\\///' | tee " & tempFile & " | cut -f1 -d/ | sort -u"
		set theAlbumNames to paragraphs of (do shell script theScript)
		repeat with theKey in theAlbumNames
			set theScript to "awk -v album=" & quoted form of theKey & " -F/ '$1 == album {print $2}' " & tempFile
			set theImageNames to paragraphs of (do shell script theScript)
			set theAlbumName to (do shell script "echo " & quoted form of theKey & "| sed 's/:/\\//g'")
			tell application "iPhoto"
				if not (exists album theAlbumName) then
					new album name theAlbumName
				end if
				select album theAlbumName
				repeat with theImageName in theImageNames
					if not (exists (some photo of album theAlbumName whose image filename is theImageName)) then
						add (first photo whose image filename is theImageName) to album theAlbumName
					end if
					if shouldQuit then error
				end repeat
			end tell
		end repeat
		cleanup()
	on error e number n partial result p from f to t
		cleanup()
		error e number n partial result p from f to t
	end try
end importAlbumsFromLibrary

on quit {}
	global shouldQuit
	set shouldQuit to true
	continue quit
end quit

on cleanup()
	global tempFile
	do shell script "rm -f " & tempFile
end cleanup


[ Reply to This | # ]
Reuniting iPhoto libraries not on cd?
Authored by: billa on Mar 10, '04 09:38:41PM

Guys - I've been using "Library Manager" for over a year... and, what I've had to do in the past to re-introduce photos to the "
default" library was; go into each library and actually delete the "data" , "thumbs", and "originals" folders in EACH date (as you know, each library is organized by the month number and the actual day, right?). Once this was done, I dragged each MONTH back into iPhoto as a new album... (you can change the name, or better yet, just delete the album later; the pics will still be in the full library...). Why do all of this?? Well, in iPhoto 2, anyway, each THUMBNAIL image or original (non-rotated) image was added separately... creating AT LEAST a double set of pictures you have to deal with later... (just trying to figure out which is the full size, and which is the thumbnail is a nightmare...) Did this change in 4?? I dunno... UPS will be delivering my iLife 04 tomorrow... I'll let ya know! smile! bk



[ Reply to This | # ]