Hi,
Here is the sqlite command to get the modelid of the albums (the folderUuid of the folder is 0hSjVxyQT4CYtRr5GMDhQQ as example):
select modelid from RKAlbum where folderUuid = "0hSjVxyQT4CYtRr5GMDhQQ" and albumSubclass = 3;
Here is the sqlite command to get the name of the photos in an album (17 is a modelid of the album as example) :
select RKAlbumVersion.name from RKMaster, RKVersion, RKAlbumVersion where RKAlbumVersion.albumId = 17 and RKMaster.modelId = RKVersion.masterId and RKVersion.modelId = RKAlbumVersion.versionId;
I do not know enough ruby, but here's an example of a bash script :
#!//bin/bash
myfolderUuid="0hSjVxyQT4CYtRr5GMDhQQ" ## a folderUuid in the RKFolder table
sqlite3 ~/'Pictures/iPhoto Library.photolibrary/Database/apdb/Library.apdb' 'select modelid, name from RKAlbum where folderUuid = "'$myfolderUuid'" and albumSubclass = 3;' | while read line; do
echo "Album name = "${line##*|} ## print the name of this album
## print photo's name of this album
sqlite3 ~/'Pictures/iPhoto Library.photolibrary/Database/apdb/Library.apdb' 'select RKVersion.name from RKMaster, RKVersion, RKAlbumVersion where RKAlbumVersion.albumId = '${line%%|*}' and RKMaster.modelId = RKVersion.masterId and RKVersion.modelId = RKAlbumVersion.versionId;'
echo "" ## print blank line
done